async for common VMs (untested)

This commit is contained in:
abrown38 committed 2024-04-16 19:16:06 +00:00
1 parent f04f4365fb
commit 9c4f61b3b2
1 file changed
+43 -28
+43 -28
View File
@@ -220,32 +220,47 @@
delay: 60
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)
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 }}"
# Add async to this task for speed. can openstack handle 6 at once or split 3 3???
- name: Wait for common VMs to build
os_server_info:
name: "{{ os_project }}-{{ win_project }}-*"
filters:
metadata:
type: server
vm_state: active
register: common_status
until: 'common_status.servers|length == 6'
retries: 100
delay: 60
# Add async to this task for speed. can openstack handle 6 at once or split 3 3???