Open gnuhub opened 10 years ago
mkdir -p /usr/local/etc/ansible/
subl /usr/local/etc/ansible/hosts
192.168.8.8
sudo password vagrant
111111
ssh-copy-id vagrant@192.168.8.8
ansible all -m ping -u vagrant -vvvv
<192.168.8.8> ESTABLISH CONNECTION FOR USER: vagrant
<192.168.8.8> REMOTE_MODULE ping
<192.168.8.8> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/stallman/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=vagrant', '-o', 'ConnectTimeout=10', '192.168.8.8', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1407259939.25-116493917983084 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1407259939.25-116493917983084 && echo $HOME/.ansible/tmp/ansible-tmp-1407259939.25-116493917983084'"]
<192.168.8.8> PUT /var/folders/71/3ck56qx933bfpqj96m87gx400000gn/T/tmpp1J2GT TO /home/vagrant/.ansible/tmp/ansible-tmp-1407259939.25-116493917983084/ping
<192.168.8.8> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/stallman/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=vagrant', '-o', 'ConnectTimeout=10', '192.168.8.8', u"/bin/sh -c 'LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1407259939.25-116493917983084/ping; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1407259939.25-116493917983084/ >/dev/null 2>&1'"]
192.168.8.8 | success >> {
"changed": false,
"ping": "pong"
}
ansible all -a "/bin/echo hello" -u vagrant
192.168.8.8 | success | rc=0 >>
hello
chef puppet ansible - ansible ssh