I'm trying to split up a large playbook into roles and it's going pretty well except I'm having trouble with variables not being pulled in from the roles vars or defaults files.
My playbook has this test playbook with a pre_task:
# zadmin_password: Today123zadmin
# root_password: Today123
msg: "Playbook WILL REBOOT when requested."
I've moved the "vars:" section (commented out above) to the main.yml files in both the "vars" and "defaults" directories like this:
When the playbook is run, I get this error:
TASK [debug] *******************************************************************
fatal: [system.example.com]: FAILED! => {"failed": true, "msg": "The conditional check 'doreboots' failed. The error was: error while evaluating conditional (doreboots): 'doreboots' is undefined\n\nThe error appears to have been in '/etc/ansible/roles/sysprep/test.yml': line 10, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n pre_tasks:\n - debug:\n ^ here\n"}
Or more human readable:
The conditional check 'doreboots' failed. The error was: error while evaluating conditional (doreboots): 'doreboots' is undefined
The error appears to have been in '/etc/ansible/roles/sysprep/test.yml': line 10, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
Thoughts?
Thanks!
Dan