Are the guests you are managing also SLES?
Have you modified anything else in your ansible.cfg?
What transport are you using?
etc
Are the guests you are managing also SLES?
Have you modified anything else in your ansible.cfg?
What transport are you using?
etc
Here is ansible.cfg
[defaults]
hostfile = /export/home/jal/ansible/ansible_hosts
module_name = ping
remote_tmp = $HOME/.ansible/tmp
pattern = *
forks=5
timeout=10
poll_interval=15
sudo_user=root
transport=paramiko
remote_port=22
sudo_exe=sudo
ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:
%S by {uid} on {host}
action_plugins = /usr/share/ansible_plugins/action_plugins
callback_plugins = /usr/share/ansible_plugins/callback_plugins
connection_plugins = /usr/share/ansible_plugins/connection_plugins
lookup_plugins = /usr/share/ansible_plugins/lookup_plugins
vars_plugins = /usr/share/ansible_plugins/vars_plugins
filter_plugins = /usr/share/ansible_plugins/filter_plugins
[paramiko_connection]
[ssh_connection]
ssh_args=-o PasswordAuthentication=no -o ControlMaster=auto -o
ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r
Here is some -vvv output where ping to xxx is to the same host I am
running the command on. This machine is SLES11SP2 but others are SP1
or SLES10 SP4.
% echo $SHELL
/bin/csh
[py-env0] 324 xxx:/export/home/jal/ansible% ansible -vvv xxx --sudo
<xxx> ESTABLISH CONNECTION FOR USER: jal on PORT 22 TO xxx
<xxx> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/
ansible-1368160527.82-22673769589329 && chmod a+rx $HOME/.ansible/tmp/
ansible-1368160527.82-22673769589329 && echo $HOME/.ansible/tmp/
ansible-1368160527.82-22673769589329'
<xxx> REMOTE_MODULE ping
<xxx> PUT /tmp/tmpnY4SrN TO /export/home/jal/.ansible/tmp/
ansible-1368160527.82-22673769589329/ping
<xxx> EXEC /bin/sh -c "sudo -k && sudo -H -S -p \"[sudo via ansible,
key=dliauzrktkxngnjgqjrwicovipfkwgns] password: \" -u root /bin/sh -c
' /usr/bin/python /export/home/jal/.ansible/tmp/
ansible-1368160527.82-22673769589329/ping; rm -rf /export/home/
jal/.ansible/tmp/ansible-1368160527.82-22673769589329/ >/dev/null
2>&1'"
xxx | FAILED >> {
"failed": true,
"msg": "Unmatched \".\r\n",
"parsed": false
}
[py-env0] 325 xxx:/export/home/jal/ansible% ansible -vvv xxx
<xxx> ESTABLISH CONNECTION FOR USER: jal on PORT 22 TO xxx
<xxx> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/
ansible-1368160534.52-212786638814322 && chmod a+rx $HOME/.ansible/tmp/
ansible-1368160534.52-212786638814322 && echo $HOME/.ansible/tmp/
ansible-1368160534.52-212786638814322'
<xxx> REMOTE_MODULE ping
<xxx> PUT /tmp/tmpeeNv5x TO /export/home/jal/.ansible/tmp/
ansible-1368160534.52-212786638814322/ping
<xxx> EXEC /bin/sh -c ' /usr/bin/python /export/home/jal/.ansible/tmp/
ansible-1368160534.52-212786638814322/ping; rm -rf /export/home/
jal/.ansible/tmp/ansible-1368160534.52-212786638814322/ >/dev/null
2>&1'
xxx | success >> {
"changed": false,
"ping": "pong"
}
What version of ansible also?
Sounds like your JSON isn’t being parsed correctly, you may wish to debug on the remote host using the ./hacking/test-module script in the checkout.
I’m not sure why that would be.
Sounds like your JSON isn't being parsed correctly, you may wish to debug
on the remote host using the ./hacking/test-module script in the checkout.
The scripts (-vvv) seem to work when invoked manually on the remote
node. The pattern /bin/sh -c ' list of commands here' doesn't work
when passed via paramiko or ssh to sudo on the remote node. The
result is a sudo error message, which not surprisingly does not parse
as json, hence the error message I got.
Omitting the /bin/sh -c part at the front seems to work (manually) via
ssh. I'm not sure why that is there, as lib/ansible/runner/
connection_plugins/ssh.py evidently has the option but it is never
used, the parameter always being /bin/sh.
Ultimately the issue seems to be sudo, which I am continuing to
explore.
Perhaps a small amount of debugging could yield the sudo error message you are getting?
Haven’t heard this reported before, I’ll see tomorrow who else in channel has some SLES – think we would have heard this already…
Thanks!
Solved. My default shell is csh which is invoked everywhere (via NIS); the quoted string used for sudo is not properly handled by csh.
Switching my account to bash fixed it. Huh. Not that I care; i was always doing sh or bash manually anyways.
–John