Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Raw module adds substring "/bin/sh -c" to ssh remote command argument. #3332
OS / ENVIRONMENT
Running Ansible from:
Managing: N/A (set of diffferent Cisco devices)
Raw module doesn't run remote commands on boxes without "/bin/sh" via ssh.
STEPS TO REPRODUCE
The output should contain the result of remote command execution like the following:
Raw module adds substring "/bin/sh -c" to ssh remote command argument.
I'm not sure this should be logged here, since
fixed via http://github.com/ansible/ansible/commit/e9a4526251d24370ffcd1761cb62460c4f548676, now you can set
Setting executable: '' in playbook works fine.
Just hit this too, setting ansible_shell_executable in ansible-hosts file nearly works (stops the /bin/sh -c) but there is still a "&& sleep 0" added to the command sent:
does indeed work as expected.
This was working in the past as I was using raw commands on this chassis some months ago.
I've just run into this also, connecting to Cisco routers.
But the only thing that actually works is as @analogbyte mentioned:
Ansible version: ansible 18.104.22.168 running in ubuntu 14.04
I have no problem with this using following ansible versions:
ansible 22.214.171.124 (detached HEAD f15e1f25ae)
I don't use any executable variables.
my current ~/.ansible.cfg:
"Show version/show clock" works but not "show vlan brief"?
ansible r1 -a "show clock"
08:01:16.590 EDT Sun Jul 2 2017
$ ansible r1 -m raw -a "show vlan brief"