-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.yml
102 lines (97 loc) · 3.11 KB
/
main.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
---
- name: Setup passwords
hosts: localhost
vars_files:
- vars/vsphere_vars.yml
- vars/common_vars.yml
vars_prompt:
- name: "vcenter_password"
prompt: "Enter password for {{ vsphere_vcenter_username }} - {{ vsphere_vcenter_hostname }}"
private: yes
- name: "template_password"
prompt: "Enter password for local administrator template for user {{ common_local_admin }}"
private: yes
tasks:
- set_fact:
vcenter_password: "{{ vcenter_password }}"
template_password: "{{ template_password }}"
- name: Build Windows AD Forest
hosts: dc
become: false
gather_facts: false
collections:
- community.vmware
pre_tasks:
- include_vars: vars/vsphere_vars.yml
- include_vars: vars/common_vars.yml
- include_vars: vars/ad_vars.yml
vars:
- vcenter_password: "{{ hostvars['localhost']['vcenter_password'] }}"
- template_password: "{{ hostvars['localhost']['template_password'] }}"
tasks:
- import_tasks: tasks/vmware_create_ad/main.yml
serial: 1
- name: Build Windows Server/s
hosts: win_server
become: false
gather_facts: false
collections:
- community.vmware
pre_tasks:
- include_vars: vars/vsphere_vars.yml
- include_vars: vars/common_vars.yml
- include_vars: vars/ad_vars.yml
vars:
- vcenter_password: "{{ hostvars['localhost']['vcenter_password'] }}"
- template_password: "{{ hostvars['localhost']['template_password'] }}"
tasks:
- import_tasks: tasks/vmware_create_windows_servers/main.yml
serial: 1
- name: Build Windows Client/s
hosts: win_client
become: false
gather_facts: false
collections:
- community.vmware
pre_tasks:
- include_vars: vars/vsphere_vars.yml
- include_vars: vars/common_vars.yml
- include_vars: vars/ad_vars.yml
vars:
- vcenter_password: "{{ hostvars['localhost']['vcenter_password'] }}"
- template_password: "{{ hostvars['localhost']['template_password'] }}"
tasks:
- import_tasks: tasks/vmware_create_windows_clients/main.yml
serial: 1
- name: Build Linux Server/s
hosts: lin_server
become: false
gather_facts: false
collections:
- community.vmware
pre_tasks:
- include_vars: vars/vsphere_vars.yml
- include_vars: vars/common_vars.yml
- include_vars: vars/ad_vars.yml
vars:
- vcenter_password: "{{ hostvars['localhost']['vcenter_password'] }}"
- template_password: "{{ hostvars['localhost']['template_password'] }}"
tasks:
- import_tasks: tasks/vmware_create_linux_servers/main.yml
serial: 1
- name: Build Linux Client/s
hosts: lin_client
become: false
gather_facts: false
collections:
- community.vmware
pre_tasks:
- include_vars: vars/vsphere_vars.yml
- include_vars: vars/common_vars.yml
- include_vars: vars/ad_vars.yml
vars:
- vcenter_password: "{{ hostvars['localhost']['vcenter_password'] }}"
- template_password: "{{ hostvars['localhost']['template_password'] }}"
tasks:
- import_tasks: tasks/vmware_create_linux_clients/main.yml
serial: 1