LoginSignup
0
1

More than 5 years have passed since last update.

AnsibleのGathering FactsでAuthentication or permission failure.

Last updated at Posted at 2018-06-20

実行コマンド

$ ansible-playbook make_my_env.yml -K

エラー文

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `\" && echo ansible-tmp-1529461607.904595-153673846566447=\"` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `\" ), exited with result 1", "unreachable": true}
        to retry, use: --limit @/mnt/c/Users/miyagaw61/home/src/github.com/miyagaw61/chikuwansible/make_my_env.retry

注目した場所

Failed command was: 
( 
umask 77 && mkdir -p \"` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `\" && echo ansible-tmp-1529461607.904595-153673846566447=\"` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `\"
)

解決法

コマンド部分を切り抜いてみる

umask 77 && mkdir -p \"` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `\" && echo ansible-tmp-1529461607.904595-153673846566447=\"` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `\"

エスケープを除く

umask 77 && mkdir -p "` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `" && echo ansible-tmp-1529461607.904595-153673846566447="` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `"

実行

$ umask 77 && mkdir -p "` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `" && echo ansible-tmp-1529461607.904595-153673846566447="` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `"
mkdir: cannot create directory ‘/home/miyagaw61/.ansible/tmp’: Permission denied

削除

$ sudo rm -rf ~/.ansible/tmp

再実行

$ umask 77 && mkdir -p "` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `" && echo ansible-tmp-1529461607.904595-153673846566447="` echo /home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447 `"
ansible-tmp-1529461607.904595-153673846566447=/home/miyagaw61/.ansible/tmp/ansible-tmp-1529461607.904595-153673846566447
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1