本文介绍了变量中的Ansible Vault密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种方法可以在Ansible剧本中作为变量访问库密码?我正在寻找这样的东西:
Is there a way to access the vault password as a variable in an Ansible playbook? I am looking for something like this:
---
debug: var=ansible_vault_password
推荐答案
我最终通过将本地Vault密码文件复制到服务器来解决了这个问题.要做的任务看起来像这样:
I ended up solving this by copying the local vault password file to the server. The task to do that looks like that:
- name: setup ansible vault password file
copy:
src: /path/to/local/vault_pass
dest: /root/.vault_pass
mode: 0600
owner: root
group: root
然后root
用户将执行ansible-pull
命令.
这篇关于变量中的Ansible Vault密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!