Please go through
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



On Wed, Jun 15, 2022 at 7:08 PM Jeff S <[email protected]> wrote:

> Sure, why not
>
> On Wednesday, June 15, 2022 at 3:20:19 PM UTC+2 Abhijeet Kasurde wrote:
>
>> 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.
>>
>> On Wed, Jun 15, 2022 at 6:37 PM Jeff S <[email protected]> wrote:
>>
>>> 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!
>>>
>>> On Wednesday, June 15, 2022 at 1:47:55 PM UTC+2 Abhijeet Kasurde wrote:
>>>
>>>> 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.
>>>>
>>>> On Wed, Jun 15, 2022 at 4:37 PM Jeff S <[email protected]> wrote:
>>>>
>>>>> 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*
>>>>>
>>>>> --
>>>>> 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 [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/ansible-project/d0450da4-14db-463b-9b4c-b7fcbe17c458n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/d0450da4-14db-463b-9b4c-b7fcbe17c458n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>
>>>>
>>>> --
>>>> Thanks,
>>>> Abhijeet Kasurde
>>>>
>>> --
>>> 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 [email protected].
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/7e8bef26-4488-419f-903b-e43294b61ef5n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/7e8bef26-4488-419f-903b-e43294b61ef5n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Thanks,
>> Abhijeet Kasurde
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d39b1a09-0d63-49b0-aa96-b1ba501d2d01n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d39b1a09-0d63-49b0-aa96-b1ba501d2d01n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Thanks,
Abhijeet Kasurde

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFwWkHrOcLDvUQ%3DfYeATxfurHMGqfNRyFDAG-NRn_KChpwkSVA%40mail.gmail.com.

Reply via email to