Hi All,
On AWX I’m using the Survey to defined variables for creating a new VM Machine.
There’re two cases of VM that I want to create, one with one interfaces and the other with 2 interfaces.
I thought of inserting a conditional (when) for the creation of a second interface (because I cannot pass null values). With host2int equal true or false But unfortunately, this conditionals didn’t works. I thought too, to add a vmware_guest_network to add a new interface but unfortunately this module doesn’t contain ip address and so on.
- name: Create VM
vmware_guest:
annotation: " "
hostname: “{{ vmware_vcenter }}”
username: “{{ vmware_user }}”
password: “{{ vmware_password }}”
validate_certs: false
datacenter: “{{ vmware_datacenter }}”
state: poweredoff
folder: “{{ vmware_folder }}”
template: “{{ vmware_template_oss }}”
name: “{{ vmware_vmname }}”
cluster: “{{ vmware_cluster }}”
datastore: “{{ vmware_datastore }}”
networks: - name: “{{ vmware_network }}”
device_type: “{{ vmware_netdev }}”
ip: “{{ vmware_network_ip }}”
netmask: “{{ vmware_network_mask }}”
gateway: “{{ vmware_network_gw }}”
vlan: “{{ vmware_network_vlan }}”
start_connected: true - name: “{{ vmware_network2 }}”
device_type: “{{ vmware_netdev }}”
ip: “{{ vmware_network_ip2 }}”
netmask: “{{ vmware_network_mask2 }}”
vlan: “{{ vmware_network_vlan2 }}”
start_connected: “{{ host2int }}”
when: host2int | bool
customization:
dns_servers: “{{ vmware_network_dnsserver_choice }}”
domain: “{{ vmware_network_domain }}”
dns_suffix: “{{ vmware_network_dns_suffix }}”
hostname: “{{ vmware_vmhostname }}”
wait_for_ip_address: true
delegate_to: localhost
become: false
Someone has any idea how to resolve this configurations?
Does something already exist for his situation?
Thank you in advance and best regards,
H