我正在尝试运行剧本
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'"
}
我不明白我做错了什么......