-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathrestricted_static_ips.yml
115 lines (103 loc) · 2.91 KB
/
restricted_static_ips.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
- hosts: all
gather_facts: True
tasks:
- name: Initial setup and checks
import_role:
name: setup
tags:
- always
- name: Set the cache of all the download links
import_role:
name: cache
- hosts: localhost
gather_facts: True
environment:
PATH: "{{ playbook_dir }}/bin:{{ ansible_env.PATH }}"
tasks:
- name: Run all the common pre-install tasks
import_role:
name: common
tasks_from: pre_install
- name: Configure F5
ansible.builtin.import_role:
name: f5
when: f5.enabled | default(false)
- hosts: registries
gather_facts: False
tasks:
- name: Run the setup tasks for a restricted environment
import_role:
name: restricted
tasks_from: setup_registry
when: registry.enabled | bool and registry.disconnected | bool
- hosts: localhost
gather_facts: False
tasks:
- name: Run the tasks for a restricted environment
import_role:
name: restricted
tasks_from: utilize_registry
when: registry.enabled | bool and registry.disconnected | bool
- hosts: localhost
gather_facts: True
environment:
PATH: "{{ playbook_dir }}/bin:{{ ansible_env.PATH }}"
tasks:
- name: Run all the common tasks
import_role:
name: common
tasks_from: install
- hosts: webservers
gather_facts: False
environment:
PATH: "{{ playbook_dir }}/bin:{{ ansible_env.PATH }}"
tasks:
- name: Set required facts
set_fact:
download: "{{ hostvars[groups['all'].0].download }}"
config: "{{ hostvars[groups['all'].0].config }}"
when:
- config is not defined
- download is not defined
- inventory_hostname != "localhost"
- name: Copy over generated ignition files to webserver
import_role:
name: webserver
tasks_from: copy_ign_files
- name: Download the installer raw.gz file to webserver
import_role:
name: webserver
tasks_from: download_raw_installer_files
- hosts: localhost
gather_facts: False
environment:
PATH: "{{ playbook_dir }}/bin:{{ ansible_env.PATH }}"
tasks:
- name: Create the DHCP based VMs
environment:
GOVC_USERNAME: "{{ vcenter.username }}"
GOVC_PASSWORD: "{{ vcenter.password }}"
GOVC_URL: "https://{{ vcenter.ip }}"
GOVC_DATACENTER: "{{ vcenter.datacenter }}"
GOVC_INSECURE: 1
vars:
static: true
import_role:
name: vsphere_vm
- name: Run steps for static ip setup of VMs
import_role:
name: static_ips
- name: Run steps to finish cluster install
import_role:
name: finish_install
- name: F5 Cleanup
hosts: localhost
gather_facts: False
tasks:
- name: Remove bootstrap server from API VIP on f5
ansible.builtin.import_role:
name: f5
vars:
bootstrap_finished: True
when: f5.enabled | default(false)