Hi there —
I have a variable called pbis_require_membership_of defined in group_vars/all.yaml, and it is overridden for a particular host under role/vars/hostname, however neither of the values are being used at runtime and the module errors with pbis_require_membership_of’ is undefined
`
(ansible)[ansible@ansible-server code]$ grep -R pbis_require_membership_of group_vars/
group_vars/all/all.yaml:pbis_require_membership_of: ‘“DOMAIN\teaminfra” “DOMAIN\LinuxAdmins”’
(ansible)[ansible@ansible-server code]$ grep -R pbis_require_membership_of roles/linux-pbis/vars/hostname
pbis_require_membership_of: ‘“DOMAIN\teaminfra” “DOMAIN\LinuxAdmins” “DOMAIN\StorageAdmins”’
`
However, the following occurs when I try to reference it at runtime:
`
TASK [linux-pbis : debug pbis_require_membership_of] ******************************************************************************************************************************************************************************
task path: roles/linux-pbis/tasks/main.yaml:62
ok: [hostname] => {
“pbis_require_membership_of”: “VARIABLE IS NOT DEFINED!”
}
…
TASK [linux-pbis : copy temp config file] ******************************************************************************************************************************************************************************
task path: roles/linux-pbis/tasks/reconfig_pbis.yaml:1
fatal: [hostname]: FAILED! => {“failed”: true, “msg”: “The conditional check ‘require_membership_of.stdout != pbis_require_membership_of’ failed. The error was: error while evaluating conditional (require_membership_of.stdout != pbis_require_membership_of): ‘pbis_require_membership_of’ is undefined\n\nThe error appears to have been in ‘roles/linux-pbis/tasks/reconfig_pbis.yaml’: line 1, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: copy temp config file\n ^ here\n”}
to retry, use: --limit @playbooks/linux/linux_pbis.retry
`
I’ve recently updated from Ansible 2.1 to the latest (using git pull), which may or may not have been when this issue started.
Any thoughts on why this variable is not getting set correctly?