[ovirt-users] ansible ovirt_vms parameter cloud_init_nics

Ondra Machacek omachace at redhat.com
Wed Sep 27 10:04:05 UTC 2017


On Wed, Sep 27, 2017 at 9:32 AM, TranceWorldLogic .
<tranceworldlogic at gmail.com> wrote:
> Hi,
>
> I was trying to initialize more than one nic via cloud init using ansible as
> shown below
>
> vars:
>    myNicList: [ { nic_name: "eth0, nic_boot_protocol: "dhcp", nic_on_boot:
> "true"},{ nic_name: "eth0, nic_boot_protocol: "dhcp", nic_on_boot: "true"} ]

It looks good, you just miss ", right after eth0, so it should be:

    myNicList: [ { nic_name: "eth0", nic_boot_protocol: "dhcp",
nic_on_boot: "true"},{ nic_name: "eth1", nic_boot_protocol: "dhcp",
nic_on_boot: "true"} ]

Also you can pass it as follows(could be more readable):

  myNicList:
      - nic_name: eth0
        nic_boot_protocol: dhcp
        nic_on_boot: true
      - nic_name: eth1
        nic_boot_protocol: dhcp
        nic_on_boot: true

>
> ovirt_vms:
>    auth: "{{ ovirt_auth }}"
>    name: test
>    ...
>    cloud_init_nics : "{{ myNicList }}"
>
> Here I am getting error object is type none.
> When I tired to debug ovirt_vms module it showed me below outpu:
>
>    cloud_init_nics: [
>        {},
>        {}
>    ]
>
> My quesion is, how can I pass list of dictionary in ansible to ovirt_vms via
> variable ?
>
> Please help me, I am stuck.
>
> Thanks,
> ~Rohit
>
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>


More information about the Users mailing list