mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-30 06:36:51 +00:00
async for common VMs (untested)
This commit is contained in:
1 parent
f04f4365fb
commit
9c4f61b3b2
1 file changed
+43
-28
@@ -220,32 +220,47 @@
|
|||||||
delay: 60
|
delay: 60
|
||||||
when: 'async_gpu.skipped == false'
|
when: 'async_gpu.skipped == false'
|
||||||
|
|
||||||
|
- name: Common VMs
|
||||||
|
block:
|
||||||
|
- name: Create Common VMs (DCs, Fileservers, WSUS, Chocolatey)
|
||||||
|
openstack.cloud.server:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
state: "{{ state }}"
|
||||||
|
image: c5d5abb3-c15a-4870-b9b7-89873ae9a9a6
|
||||||
|
flavor: 3661211f-673a-4777-8857-fd243d6c407d
|
||||||
|
timeout: 900
|
||||||
|
boot_from_volume: true
|
||||||
|
volume_size: 40
|
||||||
|
terminate_volume: yes
|
||||||
|
security_groups:
|
||||||
|
- domain_member
|
||||||
|
- "{{ item.security_group }}"
|
||||||
|
network: "{{ os_network }}"
|
||||||
|
metadata:
|
||||||
|
name: "{{ item.meta_name }}"
|
||||||
|
win_project: "{{ win_project }}"
|
||||||
|
type: server
|
||||||
|
variant: "{{ item.security_group }}" # just happens to match maybe change???
|
||||||
|
os: windows
|
||||||
|
userdata: |
|
||||||
|
#ps1
|
||||||
|
Rename-Computer "{{ win_project }}-{{ item.meta_name }}"
|
||||||
|
$admin = [adsi]("WinNT://./Administrator, user")
|
||||||
|
$admin.PSBase.Invoke("SetPassword", "{{ vm_initial_password }}")
|
||||||
|
Invoke-Expression ((New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))
|
||||||
|
loop: "{{ standard_vms }}"
|
||||||
|
async: 900
|
||||||
|
poll: 0
|
||||||
|
|
||||||
- name: Create Common VMs (DCs, Fileservers, WSUS, Chocolatey)
|
- name: Wait for common VMs to build
|
||||||
openstack.cloud.server:
|
os_server_info:
|
||||||
name: "{{ item.name }}"
|
name: "{{ os_project }}-{{ win_project }}-*"
|
||||||
state: "{{ state }}"
|
filters:
|
||||||
image: c5d5abb3-c15a-4870-b9b7-89873ae9a9a6
|
metadata:
|
||||||
flavor: 3661211f-673a-4777-8857-fd243d6c407d
|
type: server
|
||||||
timeout: 900
|
vm_state: active
|
||||||
boot_from_volume: true
|
register: common_status
|
||||||
volume_size: 40
|
until: 'common_status.servers|length == 6'
|
||||||
terminate_volume: yes
|
retries: 100
|
||||||
security_groups:
|
delay: 60
|
||||||
- domain_member
|
# Add async to this task for speed. can openstack handle 6 at once or split 3 3???
|
||||||
- "{{ item.security_group }}"
|
|
||||||
network: "{{ os_network }}"
|
|
||||||
metadata:
|
|
||||||
name: "{{ item.meta_name }}"
|
|
||||||
win_project: "{{ win_project }}"
|
|
||||||
type: server
|
|
||||||
variant: "{{ item.security_group }}" # just happens to match maybe change???
|
|
||||||
os: windows
|
|
||||||
userdata: |
|
|
||||||
#ps1
|
|
||||||
Rename-Computer "{{ win_project }}-{{ item.meta_name }}"
|
|
||||||
$admin = [adsi]("WinNT://./Administrator, user")
|
|
||||||
$admin.PSBase.Invoke("SetPassword", "{{ vm_initial_password }}")
|
|
||||||
Invoke-Expression ((New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))
|
|
||||||
loop: "{{ standard_vms }}"
|
|
||||||
# Add async to this task for speed. can openstack handle 6 at once or split 3 3???
|
|
||||||
Reference in new issue
Block a user