add base
This commit is contained in:
30
tasks/02create_first.yaml
Normal file
30
tasks/02create_first.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Create virtual machines from template
|
||||
community.vmware.vmware_guest:
|
||||
hostname: "{{ vcenter_hostname }}"
|
||||
username: "{{ vcenter_username }}"
|
||||
password: "{{ vcenter_password }}"
|
||||
validate_certs: false
|
||||
folder: "/{{ datacenter }}/vm/{{ vm_parent_folder_name }}/{{ vm_folder_name }}"
|
||||
datacenter: "{{ datacenter }}"
|
||||
cluster: "{{ cluster }}"
|
||||
datastore: "{{ datastore }}"
|
||||
resource_pool: "{{ resource_pool }}"
|
||||
name: "test-{{ item.value.hostname }}"
|
||||
template: "{{ vm_hostname_template }}"
|
||||
state: poweredon
|
||||
disk:
|
||||
- size: 100gb
|
||||
advanced_settings:
|
||||
- key: "guestinfo.ignition.config.data"
|
||||
value: "{{ lookup('template', 'ignition/{{ item.value.hostname }}.json') | b64encode }}"
|
||||
- key: "guestinfo.ignition.config.data.encoding"
|
||||
value: "base64"
|
||||
wait_for_ip_address: true
|
||||
wait_for_ip_address_timeout: 600
|
||||
with_dict: "{{ kubehosts }}"
|
||||
register: deploy_vm
|
||||
|
||||
# - name: Show debug info
|
||||
# debug:
|
||||
# msg: "{{ deploy_vm.results.instance.ipv4 }}"
|
||||
Reference in New Issue
Block a user