Skip to content

Instantly share code, notes, and snippets.

@e30chris
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e30chris/de3ced35f223fdb8c53a to your computer and use it in GitHub Desktop.
Save e30chris/de3ced35f223fdb8c53a to your computer and use it in GitHub Desktop.
ansible root pass align run
pineApplez>Ansible-AlignPassword $ansible-playbook -i hosts site.yml -vvvv
_____________
< PLAY [None] >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
________________________________________
< TASK: common | test possible passwords >
----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
<127.0.0.1> REMOTE_MODULE command sshpass -p bmw325 ssh root@debugansible date #USE_SHELL
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1405554692.61-172321093616072 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1405554692.61-172321093616072 && echo $HOME/.ansible/tmp/ansible-tmp-1405554692.61-172321093616072']
<127.0.0.1> PUT /var/folders/lg/h1n4mcgj3bdd_60rntgcllp80000gn/T/tmpKzAs4E TO /Users/spudBud/.ansible/tmp/ansible-tmp-1405554692.61-172321093616072/command
<127.0.0.1> EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/local/opt/python/bin/python2.7 /Users/spudBud/.ansible/tmp/ansible-tmp-1405554692.61-172321093616072/command; rm -rf /Users/spudBud/.ansible/tmp/ansible-tmp-1405554692.61-172321093616072/ >/dev/null 2>&1']
changed: [debugansible] => (item=bmw325) => {"changed": true, "cmd": "sshpass -p bmw325 ssh root@debugansible date ", "delta": "0:00:02.005803", "end": "2014-07-16 16:51:34.784563", "item": "bmw325", "rc": 0, "start": "2014-07-16 16:51:32.778760", "stderr": "", "stdout": "Wed Jul 16 23:51:34 UTC 2014"}
<127.0.0.1> REMOTE_MODULE command sshpass -p bmw525 ssh root@debugansible date #USE_SHELL
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1405554694.81-39195355560078 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1405554694.81-39195355560078 && echo $HOME/.ansible/tmp/ansible-tmp-1405554694.81-39195355560078']
<127.0.0.1> PUT /var/folders/lg/h1n4mcgj3bdd_60rntgcllp80000gn/T/tmpEf9cnh TO /Users/spudBud/.ansible/tmp/ansible-tmp-1405554694.81-39195355560078/command
<127.0.0.1> EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/local/opt/python/bin/python2.7 /Users/spudBud/.ansible/tmp/ansible-tmp-1405554694.81-39195355560078/command; rm -rf /Users/spudBud/.ansible/tmp/ansible-tmp-1405554694.81-39195355560078/ >/dev/null 2>&1']
failed: [debugansible] => (item=bmw525) => {"changed": true, "cmd": "sshpass -p bmw525 ssh root@debugansible date ", "delta": "0:00:04.157897", "end": "2014-07-16 16:51:39.112045", "item": "bmw525", "rc": 5, "start": "2014-07-16 16:51:34.954148"}
stderr: Permission denied, please try again.
...ignoring
<127.0.0.1> REMOTE_MODULE command sshpass -p bmw750 ssh root@debugansible date #USE_SHELL
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1405554699.13-73466677665095 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1405554699.13-73466677665095 && echo $HOME/.ansible/tmp/ansible-tmp-1405554699.13-73466677665095']
<127.0.0.1> PUT /var/folders/lg/h1n4mcgj3bdd_60rntgcllp80000gn/T/tmp5AApZi TO /Users/spudBud/.ansible/tmp/ansible-tmp-1405554699.13-73466677665095/command
<127.0.0.1> EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/local/opt/python/bin/python2.7 /Users/spudBud/.ansible/tmp/ansible-tmp-1405554699.13-73466677665095/command; rm -rf /Users/spudBud/.ansible/tmp/ansible-tmp-1405554699.13-73466677665095/ >/dev/null 2>&1']
failed: [debugansible] => (item=bmw750) => {"changed": true, "cmd": "sshpass -p bmw750 ssh root@debugansible date ", "delta": "0:00:03.670268", "end": "2014-07-16 16:51:42.949524", "item": "bmw750", "rc": 5, "start": "2014-07-16 16:51:39.279256"}
stderr: Permission denied, please try again.
...ignoring
<127.0.0.1> REMOTE_MODULE command sshpass -p bmw850 ssh root@debugansible date #USE_SHELL
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1405554702.97-116733427479562 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1405554702.97-116733427479562 && echo $HOME/.ansible/tmp/ansible-tmp-1405554702.97-116733427479562']
<127.0.0.1> PUT /var/folders/lg/h1n4mcgj3bdd_60rntgcllp80000gn/T/tmp7u4q2y TO /Users/spudBud/.ansible/tmp/ansible-tmp-1405554702.97-116733427479562/command
<127.0.0.1> EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/local/opt/python/bin/python2.7 /Users/spudBud/.ansible/tmp/ansible-tmp-1405554702.97-116733427479562/command; rm -rf /Users/spudBud/.ansible/tmp/ansible-tmp-1405554702.97-116733427479562/ >/dev/null 2>&1']
failed: [debugansible] => (item=bmw850) => {"changed": true, "cmd": "sshpass -p bmw850 ssh root@debugansible date ", "delta": "0:00:03.843483", "end": "2014-07-16 16:51:46.959503", "item": "bmw850", "rc": 5, "start": "2014-07-16 16:51:43.116020"}
stderr: Permission denied, please try again.
...ignoring
________________________________________________________
< TASK: common | set_fact ansible_ssh_pass={{item.item}} >
--------------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
<debugansible> ESTABLISH CONNECTION FOR USER: root
ok: [debugansible] => (item={u'start': u'2014-07-16 16:51:32.778760', u'delta': u'0:00:02.005803', u'cmd': u'sshpass -p bmw325 ssh root@debugansible date ', u'end': u'2014-07-16 16:51:34.784563', u'stderr': u'', 'item': u'bmw325', u'stdout': u'Wed Jul 16 23:51:34 UTC 2014', 'invocation': {'module_name': 'shell', 'module_args': u'sshpass -p bmw325 ssh root@debugansible date'}, u'changed': True, u'rc': 0}) => {"ansible_facts": {"ansible_ssh_pass": "bmw325"}, "item": {"changed": true, "cmd": "sshpass -p bmw325 ssh root@debugansible date ", "delta": "0:00:02.005803", "end": "2014-07-16 16:51:34.784563", "invocation": {"module_args": "sshpass -p bmw325 ssh root@debugansible date", "module_name": "shell"}, "item": "bmw325", "rc": 0, "start": "2014-07-16 16:51:32.778760", "stderr": "", "stdout": "Wed Jul 16 23:51:34 UTC 2014"}}
skipping: [debugansible] => (item={u'start': u'2014-07-16 16:51:34.954148', u'delta': u'0:00:04.157897', u'cmd': u'sshpass -p bmw525 ssh root@debugansible date ', u'end': u'2014-07-16 16:51:39.112045', u'stderr': u'Permission denied, please try again.', 'item': u'bmw525', u'stdout': u'', 'invocation': {'module_name': 'shell', 'module_args': u'sshpass -p bmw525 ssh root@debugansible date'}, u'changed': True, u'rc': 5})
skipping: [debugansible] => (item={u'start': u'2014-07-16 16:51:39.279256', u'delta': u'0:00:03.670268', u'cmd': u'sshpass -p bmw750 ssh root@debugansible date ', u'end': u'2014-07-16 16:51:42.949524', u'stderr': u'Permission denied, please try again.', 'item': u'bmw750', u'stdout': u'', 'invocation': {'module_name': 'shell', 'module_args': u'sshpass -p bmw750 ssh root@debugansible date'}, u'changed': True, u'rc': 5})
skipping: [debugansible] => (item={u'start': u'2014-07-16 16:51:43.116020', u'delta': u'0:00:03.843483', u'cmd': u'sshpass -p bmw850 ssh root@debugansible date ', u'end': u'2014-07-16 16:51:46.959503', u'stderr': u'Permission denied, please try again.', 'item': u'bmw850', u'stdout': u'', 'invocation': {'module_name': 'shell', 'module_args': u'sshpass -p bmw850 ssh root@debugansible date'}, u'changed': True, u'rc': 5})
_______________________________________
< TASK: common | set the right password >
---------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
<debugansible> ESTABLISH CONNECTION FOR USER: root
<debugansible> REMOTE_MODULE command python -c 'import crypt; print crypt.crypt(" bmwm1", "$1$SomeSalt$")' #USE_SHELL
<debugansible> EXEC ['sshpass', '-d8', 'ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/spudBud/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'debugansible', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1405554707.13-202859374135171 && echo $HOME/.ansible/tmp/ansible-tmp-1405554707.13-202859374135171'"]
<debugansible> PUT /var/folders/lg/h1n4mcgj3bdd_60rntgcllp80000gn/T/tmpdbXsee TO /root/.ansible/tmp/ansible-tmp-1405554707.13-202859374135171/command
<debugansible> EXEC ['sshpass', '-d8', 'ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/spudBud/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'debugansible', u"/bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1405554707.13-202859374135171/command; rm -rf /root/.ansible/tmp/ansible-tmp-1405554707.13-202859374135171/ >/dev/null 2>&1'"]
changed: [debugansible] => {"changed": true, "cmd": "python -c 'import crypt; print crypt.crypt(\" bmwm1\", \"$1$SomeSalt$\")' ", "delta": "0:00:00.017359", "end": "2014-07-16 23:51:51.687356", "rc": 0, "start": "2014-07-16 23:51:51.669997", "stderr": "", "stdout": "$1$SomeSalt$b8lEsA2JtGcacJGDQBOQC0"}
_______________________________________
< TASK: common | set the right password >
---------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
<debugansible> ESTABLISH CONNECTION FOR USER: root
<debugansible> REMOTE_MODULE user name=root password=VALUE_HIDDEN group=root
<debugansible> EXEC ['sshpass', '-d9', 'ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/spudBud/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'debugansible', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1405554711.81-154107864346530 && echo $HOME/.ansible/tmp/ansible-tmp-1405554711.81-154107864346530'"]
<debugansible> PUT /var/folders/lg/h1n4mcgj3bdd_60rntgcllp80000gn/T/tmpWoZIZB TO /root/.ansible/tmp/ansible-tmp-1405554711.81-154107864346530/user
<debugansible> EXEC ['sshpass', '-d9', 'ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/spudBud/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'debugansible', u"/bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1405554711.81-154107864346530/user; rm -rf /root/.ansible/tmp/ansible-tmp-1405554711.81-154107864346530/ >/dev/null 2>&1'"]
changed: [debugansible] => {"append": false, "changed": true, "comment": "root", "group": 0, "home": "/root", "move_home": false, "name": "root", "password": "NOT_LOGGING_PASSWORD", "shell": "/bin/bash", "state": "present", "uid": 0}
_______________________________________________________
< TASK: common | set the right password for ansible too >
-------------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
<debugansible> ESTABLISH CONNECTION FOR USER: root
ok: [debugansible] => {"ansible_facts": {"ansible_ssh_pass": "bmwm1"}}
____________
< PLAY RECAP >
------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
debugansible : ok=5 changed=3 unreachable=0 failed=0
pineApplez>Ansible-AlignPassword $ssh debugansible
root@192.241.217.104's password:
Permission denied, please try again.
root@192.241.217.104's password:
Permission denied, please try again.
root@192.241.217.104's password:
Received disconnect from 192.241.217.104: 2: Too many authentication failures for root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment