【发布时间】:2017-06-06 19:11:19
【问题描述】:
我的 Ansible 主机文件:
mybox.mydomain.com ansible_ssh_pass={{mypassword}}
变量“mypassword”在文件“variables.yml”中定义:
mypassword = somepassword
有没有办法可以将“variables.yml”中的变量包含在我的主机文件中?否则,当我尝试运行一些 Ansible 命令时,会出现错误
the field 'password' has an invalid value, which appears to include a variable that is undefined. The error was: 'mypassword' is undefined
我问这个是因为最终我想使用 .yml 文件中的 Vault 加密变量(因为这是 Vault 加密单个变量的唯一方法)
【问题讨论】: