# About the vmware\_vm\_shell module, cant activate eth0 via ip command

**URL:** <https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740>\
**Category:** Ansible Project\
**Tags:** vmware, ubuntu\
**Created:** [June 15, 2022, 11:07am UTC](https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740 "2022-06-15T11:07:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_S](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@Jeff\_S](https://forum.ansible.com/u/Jeff_S)\
**Post date:** [June 15, 2022, 11:07am UTC](https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740/1 "2022-06-15T11:07:32Z")

</div>

Hello

I am currently preparing a playbook for installing and configuring HAProxy on a vmware VM, everything works so far, but i have a problem for managing the VM via ssh, as i cant **turn up** the network interface **eth0** , there must be an error in my yaml-code, or may the usage of **ip link set eth0 up** is not supported for **vmware\_vm\_shell module**.  
Please, can anyone give me some advice on solving this issue?

Task:

- name: activate eth0  
**vmware\_vm\_shell** :  
hostname: “{{ vsphere\_host }}”  
username: “{{ vsphere\_username }}”  
password: “{{ vsphere\_password }}”  
validate\_certs: “no”  
datacenter: “{{ datacenter\_name }}”  
folder: “{{ to\_infra }}”  
vm\_id: “{{ nam }}”  
vm\_username: “{{ common\_user }}”  
vm\_password: “{{ common\_pw }}”  
vm\_shell: “ **/sbin/ip** ”  
vm\_shell\_args: “ **link set eth0 up** ”

Note, the VM is running **Ubuntu**

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [June 15, 2022, 11:47am UTC](https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740/2 "2022-06-15T11:47:28Z")

</div>

vmware\_vm\_shell supports all commands which OS supports.

Try debugging using `vm_shell_args: link set eth0 up > /tmp/$$.txt 2>&1` which might reveal the error behind.

---

<div class="post-metadata">

**Author:** ![Jeff\_S](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@Jeff\_S](https://forum.ansible.com/u/Jeff_S)\
**Post date:** [June 15, 2022, 1:07pm UTC](https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740/3 "2022-06-15T13:07:06Z")

</div>

Thx for the assist, works now!

**Solution:**

- name: activate eth0  
vmware\_vm\_shell:  
hostname: “{{ vsphere\_host }}”  
username: “{{ vsphere\_username }}”  
password: “{{ vsphere\_password }}”  
validate\_certs: “no”  
datacenter: “{{ datacenter\_name }}”  
folder: “{{ to\_infra }}”  
vm\_id: “{{ nam }}”  
vm\_username: “{{ common\_user }}”  
vm\_password: “{{ common\_pw }}”  
vm\_shell: “ **/usr/bin/sudo** ”  
vm\_shell\_args: “ **ip** link set eth0 up \> /tmp/debug.txt 2\>&1”

Note, can be used to run any command with root-permissions on remote VMware-hosts, with no internet-connection setup!

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [June 15, 2022, 1:19pm UTC](https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740/4 "2022-06-15T13:19:53Z")

</div>

Would you be interested in raising a documentation update pull request against `vmware_vm_shell` with your findings? If you need a help, let me know.

---

<div class="post-metadata">

**Author:** ![Jeff\_S](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@Jeff\_S](https://forum.ansible.com/u/Jeff_S)\
**Post date:** [June 15, 2022, 1:38pm UTC](https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740/5 "2022-06-15T13:38:28Z")

</div>

Sure, why not

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [June 15, 2022, 1:54pm UTC](https://forum.ansible.com/t/about-the-vmware-vm-shell-module-cant-activate-eth0-via-ip-command/36740/6 "2022-06-15T13:54:11Z")

</div>

Please go through [https://docs.ansible.com/ansible/latest/dev\_guide/index.html](https://docs.ansible.com/ansible/latest/dev_guide/index.html) and add your example code here - [https://github.com/ansible-collections/community.vmware/blob/1f295a8dbf7745e051c1e7f2fccae79829a6c6cb/plugins/modules/vmware\_vm\_shell.py#L161](https://github.com/ansible-collections/community.vmware/blob/1f295a8dbf7745e051c1e7f2fccae79829a6c6cb/plugins/modules/vmware_vm_shell.py#L161)
