【发布时间】:2020-07-12 10:42:29
【问题描述】:
我正在尝试运行剧本
ansible-playbook \
-i inventory/preprod/inventory.ini \
--private-key ~/.ssh/id_rsa_stagging \
-u cloud-user \
--become \
--become-user=root \
cluster.yml \
--tags resolvconf
它返回这个错误:
fatal: [tivit-aiops-k8s-preprd-app-1]: FAILED! => {
"msg": "The field 'environment' has an invalid
value, which includes an undefined variable. The error
was: 'ansible.vars.hostvars.HostVarsVars object' has
no attribute 'ansible_hostname'"
}
我不明白我做错了什么......
【问题讨论】:
-
您关注的是哪个指南?
-
请发布您定义的所有 group_vars 以及您的库存结构。
标签: kubernetes ansible kubespray