I’m relatively experienced with Ansible 1.3, but just now trying to bring Ansible 2.0 for the first time in a new project (and hoping to displace chef). I Have round 1k servers to manage that use pbrun, but others installed and control pbrun,
I have traditional sudo in a few of these hosts as well, but pbrun is the preferred privilege elevation method
I use all ssh-config auth in the following example.
HELP - I really need to figure this out, as ansible will be mostly useless to me unless I can reliably use it with pbrun
$ ansible all -i myhosts -o -m shell -a ‘uptime’ -b --become-method pbrun
c00413.mydom.com | FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “”, “module_stdout”: “/bin/bash: pbrun: command not found\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
c00414.mydom.com | FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “”, “module_stdout”: “/bin/bash: pbrun: command not found\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
c00415.mydom.com | FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “”, “module_stdout”: “/bin/bash: pbrun: command not found\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
c00416.mydom.com | FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “”, “module_stdout”: “/bin/bash: pbrun: command not found\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
c00417.mydom.com | FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “”, “module_stdout”: “/bin/bash: pbrun: command not found\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
c00418.mydom.com | FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “”, “module_stdout”: “/bin/bash: pbrun: command not found\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}
$ ansible all -i myhosts -o -m shell -a ‘uptime’ -b --become-method ‘/opt/pb/bin/pbrun’
c00413.mydom.com | FAILED! => {“failed”: true, “msg”: “Privilege escalation method not found: /opt/pb/bin/pbrun”}
c00414.mydom.com | FAILED! => {“failed”: true, “msg”: “Privilege escalation method not found: /opt/pb/bin/pbrun”}
c00415.mydom.com | FAILED! => {“failed”: true, “msg”: “Privilege escalation method not found: /opt/pb/bin/pbrun”}
c00416.mydom.com | FAILED! => {“failed”: true, “msg”: “Privilege escalation method not found: /opt/pb/bin/pbrun”}
c00417.mydom.com | FAILED! => {“failed”: true, “msg”: “Privilege escalation method not found: /opt/pb/bin/pbrun”}
c00418.mydom.com | FAILED! => {“failed”: true, “msg”: “Privilege escalation method not found: /opt/pb/bin/pbrun”}
Here is my cfg file … i did make a few changes trying to troubleshoot this
[defaults]
some basic default values…
hostfile = ./hosts
inventory = ./hosts
library = /usr/share/ansible
remote_tmp = $HOME/.ansible/tmp
pattern = *
forks = 20
poll_interval = 10
sudo_user = root
transport = ssh
remote_port = 22
module_lang = C
gathering = implicit
change this for alternative sudo implementations
#sudo_exe = sudo <<changed this
#module_name = shell <<changed this
#ask_sudo_pass= true <<changed this
executable = /bin/bash <<added this
the message changed when I made that change
#FAILED! => {“changed”: false, “failed”: true, “module_stderr”: “”, “module_stdout”: “/bin/sh: pbrun: command not found\r\n”, “msg”: “MODULE FAILURE”, “p arsed”: false}
SSH timeout
timeout = 3
[ssh_connection]
ssh arguments to use
Leaving off ControlPersist will result in poor performance, so use
paramiko on older platforms rather than removing it
ssh_args = -o ControlMaster=auto -o ControlPersist=1800s
#1800 seconds is 30min