raw commands to appliances with limited SSH support

44 views
Skip to first unread message

Craig Wilson

unread,
Apr 12, 2016, 7:34:32 AM4/12/16
to Ansible Project
We are trying to issue a command to a storage appliance we have, I have setup the raw module but I am getting /bin/sh does not exist errors, how can I stop ansible executing the command as /bin/sh -c 'command rather than just sending "command", Annoyingly ansible even reports the command as successful since it successfully passed the command to the node. 

my playbook:
---
- hosts: Test01
  remote_user
: user
  gather_facts
: no  
  tasks
:
 
- name: showcon
    raw
: show con




output:
$ ansible-playbook showcon.yml  -vvvv --step


PLAY
[Test01] ******************************************************************
Perform task: showcon (y/n/c): y


Perform task: showcon (y/n/c):  ***********************************************
<test01> ESTABLISH CONNECTION FOR USER: user
<test01> EXEC sshpass -d4 ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/craig/.ansible/cp/ansible-ssh-%h-%p-%r" -o User=user -o ConnectTimeout=10 ddn7a /bin/sh -c 'show con'
ok
: [test01] => {"rc": 0, "stderr": "OpenSSH_6.9p1 Ubuntu-2ubuntu0.1, OpenSSL 1.0.2d 9 Jul 2015\r\ndebug1: Reading configuration data /home/craig/.ssh/config\r\ndebug1: /home/craig/.ssh/config line 3: Applying options for *\r\ndebug1: /home/craig/.ssh/config line 72: Applying options for *ddn*\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 2236\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to test01 closed.\r\n", "stdout": "/bin/sh -c 'show con'\r\n\r\nKeyword '/BIN/SH' does not exist\r\nOptional keywords:\r\n   ASSIGN           Assign raid object\r\n   CLEAR            Clear raid object states\r\n   CREATE           Create raid objects\r\n   DELETE           Delete raid objects\r\n   ERASE            Erase raid objects\r\n   EXPORT           Export raid objects\r\n   IMPORT           Import raid objects\r\n   LOCATE           Locate raid objects\r\n   MARK             Mark the event log\r\n   MOVE_HOME        Move raid objects\r\n   PAUSE            Pause raid objects\r\n   REPLACE          Replace raid objects\r\n   RESUME           Resume raid objects\r\n   SET              Modify raid object attributes\r\n   SHOW             Display raid objects\r\n   SHUTDOWN         Shutdown raid objects\r\n   SYNCHRONIZE      Synchronize raid objects\r\n   TEST             Test settings\r\n   UPDATE_FIRMWARE  Update firmware on raid objects\r\n   DOWNGRADE_FIRMW  Downgrade firmware on raid objects\r\n   ARE              \r\n   VERIFY           Start a Verify background job(s)\r\n\r\nTue Apr 12 11:20:37 2016\r\n"}



Reply all
Reply to author
Forward
0 new messages