Re: [ansible-project] vmware_guest_network - removing NIC - task completes but does not remove NIC

311 views
Skip to first unread message
Message has been deleted

Jorge Rúa

unread,
Jun 10, 2022, 10:59:54 AM6/10/22
to ansible...@googlegroups.com
I'd encourage you to this the other way around. First of all not sure why the ova is still using e1000 but that's a separate issue. I'd say to modify your ova and reupload it with the vmxnet3 adapter already set up. 
And the end of the day an ova is just a tar file with some metadata.
Give it a try and let me know.

On Fri, Jun 10, 2022, 14:53 Jeff S <jes.a...@gmail.com> wrote:
Hello,
I have a problem with the vmware_guest_network module, i am writing a playbook for creating an OpenShift cluster, and i am using RHCOS as OS for the cluster nodes, the nodes are created through vmware_deploy_ovf which by default attaches a Network Adapter of type vmxnet3 to each node. The problem, the booting VMs network interface wont turn up, i discovered that changing the Adapter type to e1000e will resolve the issue. Yet i cant automate this using Ansible as i cant override the Adapter type of existing NICs nor can i use vmware_guest_network to remove the NIC and replace it with an other. The task succeds, but there is no change to my VMs, the NIC was not removed. I dont really understand why this is happening and why features like these dont work as they should.

PLAYBOOK CODE:

    - name: "Deploy new rhcos VMs from ova"
      community.vmware.vmware_deploy_ovf:
        hostname: "{{ vsphere_host }}"
        username: "{{ vsphere_username }}"
        password: "{{ vsphere_password }}"
        validate_certs: "no"
        datacenter: "{{ datacenter_name }}"
        folder: "{{ to_nodes }}"
        ovf: "{{ local_path }}"
        name: "{{ item.key }}"
        networks: "{u'VM Network':u'{{ net }}'}"
        datastore: "{{ item.value.store }}"
        disk_provisioning: "{{ item.value.size_type }}"
        cluster: "{{ cluster_name }}"
        wait: no
        power_on: no
      when: item.key == "loadbalancer" #"worker1" #"loadbalancer"
      loop: "{{ lookup('dict', dict) }}"
      register: tartar

    - name: Remove NIC 
      community.vmware.vmware_guest_network:
        hostname: "{{ vsphere_host }}"
        username: "{{ vsphere_username }}"
        password: "{{ vsphere_password }}"
        validate_certs: "no"
        mac_address: tartar.results.{{ ansible_loop.index0 }}.instance.hw_eth0.macaddress
        folder: "{{ to_nodes }}"
        name: "{{ item.key }}"
        state: absent
      when: item.key == "loadbalancer" #"worker1" #"loadbalancer"
      loop: "{{ lookup('dict', dict) }}"
      loop_control:
        extended: yes
        label: "{{ item.key }}"


RESULT:

TASK [community.vmware.vmware_guest_network] ******************************************************
skipping: [localhost] => (item=master1)
skipping: [localhost] => (item=master3)
skipping: [localhost] => (item=master2)
skipping: [localhost] => (item=worker1)
skipping: [localhost] => (item=infra1)
skipping: [localhost] => (item=infra2)
skipping: [localhost] => (item=worker2)
ok: [localhost] => (item=loadbalancer)
skipping: [localhost] => (item=bootstrap)


The task should have performed a change, its marked in green so no change produced??

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/363b6c70-a58e-4af8-8c2b-c456292b2b91n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages