It’s basically the one listed in the URL.   The changes I’ve made is to add some addition ‘defaults’, and the code I mentioned below, to select different nic profiles for vms that are on different networks.

 

I’m running an Oracle Linux 7u9 system, and the version of Ansible is 2.9.18

 

In my environment, I have created different networks, and labeled them based upon their vlan tag number (vlan20, vlan21, vlan22, …)

 

A VM can be created on any of these vlans, so I need to be able to select the nic profile within ‘ini’ file holding all the configuration information. (hostname, fqdn, IP address, etc…)

 

 

From: Martin Perina <mperina@redhat.com>
Sent: Thursday, April 22, 2021 2:51 AM
To: Stier, Matthew <Matthew.Stier@fujitsu.com>
Cc: users@ovirt.org; Martin Necas <mnecas@redhat.com>
Subject: Re: [ovirt-users] Ansible ovirt.ovirt_vm nics

 

Hi Matthew,

 

Could you please share with us your playbook? Which ansible version are you using? Are you using ovirt_vm module from oVirt Ansible Collection which contains newer versions than the ovirt_vm module included in Ansible 2.9?

 

https://docs.ansible.com/ansible/latest/collections/ovirt/ovirt/ovirt_vm_module.html

 

Thanks,

Martin

 

 

On Thu, Apr 22, 2021 at 9:28 AM Matthew.Stier@fujitsu.com <Matthew.Stier@fujitsu.com> wrote:

The ‘nics’ section of ovirt_vm is vague and with nearly no examples.

 

My playbook is based upon https://blogs.oracle.com/scoter/ansible-with-oracle-linux-virtualization-manager-olvm

 

I’ve made several modifications, (more default) and added a few lines, which I believe is supposed to assign vnic profiles to the primary vnic (nic1), based upon the definition of ‘vm_nic1_profile’ defined in an included ‘ini’ file. (the profile defaulting to blank if it is not defined in the ini file.)

 

It isn’t doing its job.

 

  nics:

-   name: “nic1”

profile_name: "{{ hostvars[item]['vm_nic1_profile'] | default('') }}”

 

 

The playbook runs without complaint.  If I run it with option ‘-vvv’ part of the output lists the variables, but the ‘nics’ variable is an empty list (nics[])

 

Any hints on what I’m doing wrong?   I’ve checked the forum, but it tends to strip leading spaces, which is bad for indent sensitive code.

_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/MEZLXGSSRCRJRSMME7J3Y5XQ2AGYUWI4/



--

Martin Perina
Manager, Software Engineering
Red Hat Czech s.r.o.