[英]Ansible playbook with vault file
I'm attempting to run a playbook using a vault file, according to the docs by using the --vault-password-file
option. 根据文档 ,我尝试使用--vault-password-file
选项使用Vault文件运行剧本。
Here is my command: 这是我的命令:
sudo -u ubuntu -H sh -c "cd ~/overseer; ansible-playbook generate_keys.yml -l mgmt --vault-password-file ~/.vaultpw"
When running that, I get this output: 运行该命令时,得到以下输出:
ERROR: problem running / h o m e / u b u n t u / . v a u l t p w ([Errno 8] Exec format error)
I've tried using /home/ubuntu/.vaultpw
to no avail. 我尝试使用/home/ubuntu/.vaultpw
无济于事。
Also according to the docs, I have proper permissions on the file to read. 同样根据文档,我对文件具有适当的读取权限。
How can I fix this? 我怎样才能解决这个问题? It's not reading my vault password file correctly, it looks like it is interpreting each character as another argument 它没有正确读取我的Vault密码文件,似乎正在将每个字符解释为另一个参数
Turns out that Ansible thought .vaultpw
was a script because its permissions were 原来Ansible认为.vaultpw
是一个脚本,因为它的权限是
-rwx------
I created the file with mode 0600
我使用模式0600
创建了文件
-rw-------
And it worked great. 而且效果很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.