🐽
ansible 研究 2024/12/27
user 設定していない jail での stdoutがほにゃららする
dns@hoge | FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/local/bin/python"
},
"changed": false,
"module_stderr": "Shared connection to hoge closed.\r\n",
"module_stdout": "/usr/local/bin/python: can't open file '//\"\\'\"\\'\"\\'~strnh/.ansible/tmp/ansible-tmp-1735013447.9037137-14063-211211052999801/AnsiballZ_ping.py\\'\"\\'\"\\'\"': [Errno 2] No such file or directory\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 2
}
-
今日の結論: "ansible_remote_tmp" 変数を使おう。
-
https://docs.ansible.com/ansible/2.9_ja/reference_appendices/faq.html?highlight=remote_tmp#bsd
$ ansible -e ansible_remote_tmp=/tmp --become -m ping hoge_jails- jailなので、 root 前提だったりするのがアダとなっている。
Discussion