Ansible 字段 'password' 有一个无效值,其中包含一个未定义的变量

问题描述

当我尝试使用此命令启动 ansible 时遇到问题:

ansible -i /etc/ansible/hosts -m ping 10.0.0.4 --vault-password-file /etc/ansible/.lorem

输出

10.0.0.4 | Failed! => {
    "msg": "The field 'password' has an invalid value,which includes an undefined variable. The error was: 'super_mdp' is undefined"
}

我的主机文件

all:
  hosts:
    10.0.0.4:
        ansible_password: "{{ super_mdp }}"
        ansible_shell_type: "sh"
        ansible_user: "user"

我的变量文件

---
super_mdp: getrooted

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)