I have two problems when configuring the network of a virtual machine already created. I hava this code:
- name: Creates a new Virtual Machine from template named 'rhel7_template'
ovirt_vm:
auth: "{{ ovirt_auth }}"
state: present
name: testaes02
template: tmpl-rhv-dc20-rhel-7
cluster: KVM_DC_20_CL_LC_Linux_01
- ovirt_nic_info:
auth: "{{ ovirt_auth }}"
vm: testaes01
register: result
- debug:
msg: "{{ result.ovirt_nics[0].reported_devices[0].name }}"
- name: Run VM with cloud init
ovirt_vm:
auth: "{{ ovirt_auth }}"
name: testaes01
cloud_init:
custom_script: |
write_files:
- path: /etc/sysconfig/network-scripts/ "{{ result.ovirt_nics[0].reported_devices[0].name }}"
content: |
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.80.156
GATEWAY=192.168.80.1
NETMASK=255.255.255.0
DOMAIN="inf.sta da.inf.sta"
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
runcmd:
- /etc/sysconfig/network-scripts/ "{{ result.ovirt_nics[0].reported_devices[0].name }}"
- command systemctl restart network
user_name: root
root_password: super_password
My problem is that no add config network in the network file.
I would also like to know if there is something similar to the vmware_vm_shell module for Ovirt