could somebody please help, I am trying to create an Ansible playbook for our VMWare virtual hosts but the playbook will not work. If I run the same command on its own, it succeeds.
Single command which works
ansible vhosts -vvv -k -m shell -a "vmkfstools -Ph -v 1 /vmfs/volumes/VMFS_01 | grep Mode"
Playbook
---
- hosts: vhosts
remote_user: root
tasks:
- name: Get VMFS 01
shell: vmkfstools -Ph -v 1 /vmfs/volumes/VMFS_01 | grep Mode
Playbook Error
fatal: [10.10.10.3]: FAILED! => {"msg": "/bin/sh: sudo: not found
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 1810
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 127
Shared connection to 10.10.10.3 closed.
", "failed": true, "changed": false, "parsed": false, "invocation": {"module_name": "setup", "module_args": {}}}
ansible 2.0.0
In fact I have tried some basic modules inside the playbook and they all seem to give the same error.