Dynamic NIC list using cobbler profile

17 views
Skip to first unread message

Rakesh Dobariya

unread,
Jul 7, 2015, 8:43:32 AM7/7/15
to ansible...@googlegroups.com
Hi, 
    I wish if someonce can help me with my issue....
I am creating VM, but passing cobbler inventory using cobbler.py as below

ansible-playbook -i /etc/ansible/cobbler.py /etc/ansible/vm.yml --e {"hostname" : "esxi.server","guestname" : "vm.name"}

Below is snap for my vm.uml file

vm_extra_config:
        vcpu.hotadd: yes
        mem.hotadd:  yes
        notes: This is a test VM
      vm_disk:
        disk1:
          size_gb: "{{ host.virt_file_size }}"
          type: thin
          datastore: datastore1
      vm_nic:
        nic1:
          type: vmxnet3
          network: VM Network
          network_type: standard
          macaddress: "{{ host.interfaces.eth0.mac_address }}"
          
     All variables are available...

I am stuck in configuring nic. My cobbler profiles have 3 nics so is there any way to loop for nic1, nic2 like wise???


Reply all
Reply to author
Forward
0 new messages