我写了一个将安装loggly的剧本。现在当我为loggly运行playbook时,我在每个主机安装ansible之后卡住了。原因是什么以及如何解决这种错误。
[ec2-user@ip-10-0-0-176 ~]$ ansible-playbook -i hosts --sudo loggly.yml -^C'!database-rds' -vvvv
[ec2-user@ip-10-0-0-176 ~]$ cd TimePhone/
[ec2-user@ip-10-0-0-176 TimePhone]$ ls
bastions db_masters.yml db_slaves.yml ec2.yml hosts loggly.yml monitoring.yml README.md site.yml
bastion.yml db_rds.yml db.yml group_vars hosts.sample metadata.yml mq.yml roles TODO.md
[ec2-user@ip-10-0-0-176 TimePhone]$ ansible-playbook -i hosts --sudo loggly.yml -l '!database-rds' -vvvv
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
PLAY [loggly] *****************************************************************
GATHERING FACTS ***************************************************************
<10.0.1.121> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506525.14-11934452712572 && chmod a rx $HOME/.ansible/tmp/ansible-1393506525.14-11934452712572 && echo $HOME/.ansible/tmp/ansible-1393506525.14-11934452712572'"]
<10.0.1.117> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506525.16-151968512116932 && chmod a rx $HOME/.ansible/tmp/ansible-1393506525.16-151968512116932 && echo $HOME/.ansible/tmp/ansible-1393506525.16-151968512116932'"]
<10.0.1.116> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506525.2-223566099160120 && chmod a rx $HOME/.ansible/tmp/ansible-1393506525.2-223566099160120 && echo $HOME/.ansible/tmp/ansible-1393506525.2-223566099160120'"]
<10.0.1.121> REMOTE_MODULE setup
<10.0.1.121> PUT /tmp/tmpq9g5I4 TO /home/ec2-user/.ansible/tmp/ansible-1393506525.14-11934452712572/setup
<10.0.1.117> REMOTE_MODULE setup
<10.0.1.116> REMOTE_MODULE setup
<10.0.1.117> PUT /tmp/tmp5J9O5y TO /home/ec2-user/.ansible/tmp/ansible-1393506525.16-151968512116932/setup
<10.0.1.116> PUT /tmp/tmpiYXAaR TO /home/ec2-user/.ansible/tmp/ansible-1393506525.2-223566099160120/setup
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=ewjzevchqnrqlxbyxrchrwvkwetehvfa] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-ewjzevchqnrqlxbyxrchrwvkwetehvfa; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506525.14-11934452712572/setup; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506525.14-11934452712572/ >/dev/null 2>&1\'"\'"\'\'']
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=yoypyrvkcekygdajinnrvrrdslktsobv] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-yoypyrvkcekygdajinnrvrrdslktsobv; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506525.16-151968512116932/setup; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506525.16-151968512116932/ >/dev/null 2>&1\'"\'"\'\'']
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=aidpbfhulfttbnkljstdpdltatgjiyns] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-aidpbfhulfttbnkljstdpdltatgjiyns; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506525.2-223566099160120/setup; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506525.2-223566099160120/ >/dev/null 2>&1\'"\'"\'\'']
ok: [10.0.1.121]
ok: [10.0.1.117]
ok: [10.0.1.116]
TASK: [Copy wget_loggly.sh to all nodes] **************************************
<10.0.1.121> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506525.95-250146364178613 && chmod a rx $HOME/.ansible/tmp/ansible-1393506525.95-250146364178613 && echo $HOME/.ansible/tmp/ansible-1393506525.95-250146364178613'"]
<10.0.1.117> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506525.97-184882008093634 && chmod a rx $HOME/.ansible/tmp/ansible-1393506525.97-184882008093634 && echo $HOME/.ansible/tmp/ansible-1393506525.97-184882008093634'"]
<10.0.1.116> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506525.99-79163833621488 && chmod a rx $HOME/.ansible/tmp/ansible-1393506525.99-79163833621488 && echo $HOME/.ansible/tmp/ansible-1393506525.99-79163833621488'"]
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506526.07-255801514712490 && chmod a rx $HOME/.ansible/tmp/ansible-1393506526.07-255801514712490 && echo $HOME/.ansible/tmp/ansible-1393506526.07-255801514712490'"]
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506526.08-242148825261753 && chmod a rx $HOME/.ansible/tmp/ansible-1393506526.08-242148825261753 && echo $HOME/.ansible/tmp/ansible-1393506526.08-242148825261753'"]
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506526.09-227733730580362 && chmod a rx $HOME/.ansible/tmp/ansible-1393506526.09-227733730580362 && echo $HOME/.ansible/tmp/ansible-1393506526.09-227733730580362'"]
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', u'/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=netuhgvyiefjpzrpjwxrtqaoikwaxcfe] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-netuhgvyiefjpzrpjwxrtqaoikwaxcfe; rc=0; [ -r "/tmp/wget_loggly.sh" ] || rc=2; [ -f "/tmp/wget_loggly.sh" ] || rc=1; [ -d "/tmp/wget_loggly.sh" ] && rc=3; (/usr/bin/md5sum /tmp/wget_loggly.sh 2>/dev/null) || (/sbin/md5sum -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/digest -a md5 /tmp/wget_loggly.sh 2>/dev/null) || (/sbin/md5 -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/md5 -n /tmp/wget_loggly.sh 2>/dev/null) || (/bin/md5 -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/csum -h MD5 /tmp/wget_loggly.sh 2>/dev/null) || (echo "${rc} /tmp/wget_loggly.sh")\'"\'"\'\'']
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', u'/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=vbqudnkqukrrjkhmcwmyjubjyrlqwxzt] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-vbqudnkqukrrjkhmcwmyjubjyrlqwxzt; rc=0; [ -r "/tmp/wget_loggly.sh" ] || rc=2; [ -f "/tmp/wget_loggly.sh" ] || rc=1; [ -d "/tmp/wget_loggly.sh" ] && rc=3; (/usr/bin/md5sum /tmp/wget_loggly.sh 2>/dev/null) || (/sbin/md5sum -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/digest -a md5 /tmp/wget_loggly.sh 2>/dev/null) || (/sbin/md5 -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/md5 -n /tmp/wget_loggly.sh 2>/dev/null) || (/bin/md5 -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/csum -h MD5 /tmp/wget_loggly.sh 2>/dev/null) || (echo "${rc} /tmp/wget_loggly.sh")\'"\'"\'\'']
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', u'/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=nhgzqgdfyfjpyctbtqdbaufrwlldcthd] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-nhgzqgdfyfjpyctbtqdbaufrwlldcthd; rc=0; [ -r "/tmp/wget_loggly.sh" ] || rc=2; [ -f "/tmp/wget_loggly.sh" ] || rc=1; [ -d "/tmp/wget_loggly.sh" ] && rc=3; (/usr/bin/md5sum /tmp/wget_loggly.sh 2>/dev/null) || (/sbin/md5sum -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/digest -a md5 /tmp/wget_loggly.sh 2>/dev/null) || (/sbin/md5 -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/md5 -n /tmp/wget_loggly.sh 2>/dev/null) || (/bin/md5 -q /tmp/wget_loggly.sh 2>/dev/null) || (/usr/bin/csum -h MD5 /tmp/wget_loggly.sh 2>/dev/null) || (echo "${rc} /tmp/wget_loggly.sh")\'"\'"\'\'']
<10.0.1.121> PUT /tmp/tmpq9g5I4 TO /home/ec2-user/.ansible/tmp/ansible-1393506526.07-255801514712490/file
<10.0.1.116> PUT /tmp/tmpiYXAaR TO /home/ec2-user/.ansible/tmp/ansible-1393506526.09-227733730580362/file
<10.0.1.117> PUT /tmp/tmp5J9O5y TO /home/ec2-user/.ansible/tmp/ansible-1393506526.08-242148825261753/file
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=ukwauhedvqsirforxutwitzjyvatniea] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-ukwauhedvqsirforxutwitzjyvatniea; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506526.07-255801514712490/file; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506526.07-255801514712490/ >/dev/null 2>&1\'"\'"\'\'']
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=kiqdpjpqyoncuocfrmctprxdndagvlqw] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-kiqdpjpqyoncuocfrmctprxdndagvlqw; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506526.08-242148825261753/file; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506526.08-242148825261753/ >/dev/null 2>&1\'"\'"\'\'']
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=ulspeerlaotxpyiwdxydgrqjactptumy] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-ulspeerlaotxpyiwdxydgrqjactptumy; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506526.09-227733730580362/file; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506526.09-227733730580362/ >/dev/null 2>&1\'"\'"\'\'']
ok: [10.0.1.121] => {"changed": false, "gid": 500, "group": "ec2-user", "mode": "0755", "owner": "ec2-user", "path": "/tmp/wget_loggly.sh", "size": 163, "state": "file", "uid": 222}
ok: [10.0.1.117] => {"changed": false, "gid": 500, "group": "ec2-user", "mode": "0755", "owner": "ec2-user", "path": "/tmp/wget_loggly.sh", "size": 163, "state": "file", "uid": 222}
ok: [10.0.1.116] => {"changed": false, "gid": 500, "group": "ec2-user", "mode": "0755", "owner": "ec2-user", "path": "/tmp/wget_loggly.sh", "size": 163, "state": "file", "uid": 222}
TASK: [Instal loggly] *********************************************************
<10.0.1.121> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506526.79-56511666592169 && chmod a rx $HOME/.ansible/tmp/ansible-1393506526.79-56511666592169 && echo $HOME/.ansible/tmp/ansible-1393506526.79-56511666592169'"]
<10.0.1.117> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506526.8-124854870354902 && chmod a rx $HOME/.ansible/tmp/ansible-1393506526.8-124854870354902 && echo $HOME/.ansible/tmp/ansible-1393506526.8-124854870354902'"]
<10.0.1.116> ESTABLISH CONNECTION FOR USER: ec2-user
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1393506526.82-268957688856010 && chmod a rx $HOME/.ansible/tmp/ansible-1393506526.82-268957688856010 && echo $HOME/.ansible/tmp/ansible-1393506526.82-268957688856010'"]
<10.0.1.121> REMOTE_MODULE command /tmp/wget_loggly.sh
<10.0.1.121> PUT /tmp/tmpq9g5I4 TO /home/ec2-user/.ansible/tmp/ansible-1393506526.79-56511666592169/command
<10.0.1.117> REMOTE_MODULE command /tmp/wget_loggly.sh
<10.0.1.117> PUT /tmp/tmp5J9O5y TO /home/ec2-user/.ansible/tmp/ansible-1393506526.8-124854870354902/command
<10.0.1.116> REMOTE_MODULE command /tmp/wget_loggly.sh
<10.0.1.116> PUT /tmp/tmpiYXAaR TO /home/ec2-user/.ansible/tmp/ansible-1393506526.82-268957688856010/command
<10.0.1.121> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.121', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=hvokozpievivmcgryvfzgxpaivbcubno] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-hvokozpievivmcgryvfzgxpaivbcubno; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506526.79-56511666592169/command; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506526.79-56511666592169/ >/dev/null 2>&1\'"\'"\'\'']
<10.0.1.117> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.117', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=gaxhvmkxhteonntgjwhxdjiyxeykqgws] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-gaxhvmkxhteonntgjwhxdjiyxeykqgws; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506526.8-124854870354902/command; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506526.8-124854870354902/ >/dev/null 2>&1\'"\'"\'\'']
<10.0.1.116> EXEC ['ssh', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '10.0.1.116', '/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=vzbxphbgjdvndpmegpmgxxlxdjtqzhxi] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-vzbxphbgjdvndpmegpmgxxlxdjtqzhxi; /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-1393506526.82-268957688856010/command; rm -rf /home/ec2-user/.ansible/tmp/ansible-1393506526.82-268957688856010/ >/dev/null 2>&1\'"\'"\'\'']
$cat loggly.yml
---
# This is chris trying to install Loggly.`
- hosts: loggly
remote_user: ec2-user
sudo: yes
tasks:
- name: Copy wget_loggly.sh to all nodes
copy: src=roles/loggly/files/wget_loggly.sh dest=/tmp/wget_loggly.sh group=ec2-user mode=755
- name: Instal loggly
command: /tmp/wget_loggly.sh
notify:
- restart rsyslog
- name: ensure rsyslog is running
service: name=rsyslog state=started
handlers:
- name: restart rsyslog
service: name=rsylog state=restarted
问题是我在上面粘贴时卡住了。
答案 0 :(得分:1)
你走得很好。我检查了你的剧本,我发现Loggly安装脚本/tmp/wget_loggly.sh正在等待手动确认。
解决方案:
修改/tmp/wget_loggly.sh并添加额外参数 -y 以继续自动安装。
你的wget_loggly.sh应该是:
wget -q -O - https://www.loggly.com/install/configure-syslog.py | sudo \
python - setup --auth authkey --account youracount -y
答案 1 :(得分:0)
我认为loggly安装脚本要求键盘确认。
Do you want the Loggly Syslog Configuration Script to restart (SIGHUP) the syslog daemon. [Yes|No]: Yes