-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy_controller.yml
110 lines (96 loc) · 4.07 KB
/
deploy_controller.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
---
- name: "Deploy Controller in vCenter"
hosts: all
vars_files:
- "deployment_settings.yml"
- '{{ "site_" + deployment_site + ".yml" }}'
vars:
build_path: '{{ "/mnt/" + (build_location | default("builds")) + "/" }}'
tasks:
- name: "Deploy Avi Controller"
community.vmware.vmware_deploy_ovf:
hostname: "{{ cloud_parameters.vcenter }}"
username: "{{ cloud_parameters.username }}"
password: "{{ cloud_parameters.password }}"
datacenter: "{{ cloud_parameters.datacenter }}"
cluster: "{{ cloud_parameters.cluster }}"
datastore: "{{ cloud_parameters.datastore }}"
name: "{{ controller_nodes[0]['name'] }}"
networks: '{u"Management":u"{{ cloud_parameters.controller_network }}"}'
ovf: '{{ manual_image_path if manual_image_path is defined else (build_path + controller_version + "/" + build_name + "/controller.ova") }}'
disk_provisioning: "thin"
validate_certs: "no"
folder: '{{ cloud_parameters.datacenter + "/vm/" + cloud_parameters.controller_folder }}'
properties: |
{ u"avi.mgmt-ip.CONTROLLER":u"{{ controller_nodes[0].ip.addr }}",
u"avi.mgmt-mask.CONTROLLER":u"{{ controller_mask }}",
u"avi.default-gw.CONTROLLER":u"{{ controller_gw }}"}
power_on: "no"
allow_duplicates: "no"
register: controller_vm
- name: "Reconfigure Controller VM"
community.vmware.vmware_guest:
hostname: "{{ cloud_parameters.vcenter }}"
username: "{{ cloud_parameters.username }}"
password: "{{ cloud_parameters.password }}"
uuid: "{{ controller_vm.instance.instance_uuid }}"
use_instance_uuid: true
state: "present"
hardware:
num_cpus: "{{ controller_num_cpu }}"
memory_mb: "{{ controller_mem * 1024 }}"
disk:
- size_gb: "{{ controller_disk }}"
validate_certs: "no"
- name: "Power on Controller vm"
community.vmware.vmware_guest_powerstate:
hostname: "{{ cloud_parameters.vcenter }}"
username: "{{ cloud_parameters.username }}"
password: "{{ cloud_parameters.password }}"
uuid: "{{ controller_vm.instance.instance_uuid }}"
use_instance_uuid: true
state: "powered-on"
validate_certs: "no"
- name: "Wait for Controller to be up"
ansible.builtin.uri:
url: '{{ "https://" + controller_ip + "/api/cluster/runtime" }}'
return_content: "yes"
validate_certs: "no"
delegate_to: "localhost"
register: result
until: "result.content.find('CLUSTER_UP') != -1"
retries: 20
delay: 30
- name: "Bootstrap"
ansible.builtin.import_playbook: bootstrap.yml
when: no_bootstrap is undefined
- name: "Configure Cluster"
ansible.builtin.import_playbook: configure_cluster.yml
when: no_bootstrap is undefined
- name: "Configure System Settings"
ansible.builtin.import_playbook: configure_system_settings.yml
when: no_bootstrap is undefined
- name: "Configure License"
ansible.builtin.import_playbook: configure_license.yml
when: no_bootstrap is undefined
- name: "Configure SSL Certificates"
ansible.builtin.import_playbook: configure_sslcerts.yml
when: no_bootstrap is undefined
- name: "Configure Portal Certificate"
ansible.builtin.import_playbook: configure_portal_cert.yml
when: no_bootstrap is undefined
- name: "Configure vCenter Cloud"
ansible.builtin.import_playbook: configure_cloud.yml
when: no_bootstrap is undefined
- name: "Configure DNS Service"
ansible.builtin.import_playbook: configure_dns.yml
when: no_bootstrap is undefined
- name: "Create Profiles"
ansible.builtin.import_playbook: create_profiles.yml
when: no_bootstrap is undefined
- name: "Create Virtual Service"
ansible.builtin.import_playbook: create_vs.yml
when: no_bootstrap is undefined
- name: "GSLB Service Account Creation"
ansible.builtin.import_playbook: create_gslb_account.yml
when: no_bootstrap is undefined and gslb_member is defined