timesync
timesync copied to clipboard
[WIP] Implement idempotency & checkmode testing
Use linux-system-roles.meta_test
role to implement idempotency and checkmode testing.
[citest]
TASK [linux-system-roles.meta_test : Create a static inventory from hostvars] ***
task path: /tmp/tmptfkkvccw/tests/roles/linux-system-roles.meta_test/tasks/wrap_role_scenario.yml:28
fatal: [/cache/centos-7.qcow2c]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'generate_inventory' is undefined"}
not sure why it can't find the generate_inventory
filter function.
[citest]
[citest]
@richm generate_inventory
is visible to Jinja2 now. The problem was solved by changing {{ generate_inventory(x, ...) }}
to {{ x | generate_inventory(...) }}
. Now the problem seems to be with running timesync
in check mode.
Excerpt from log (formatted):
ansible 2.8.18
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
Using /etc/ansible/ansible.cfg as config file
META: ran handlers
/cache/centos-6.qcow2c | FAILED! => {
"msg": """The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'distribution'
The error appears to be in '/tmp/tmptl3snw93/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Set version specific variables
^ here
"""
}
It looks like there should be more variables in the generated static inventory than just those which are role specific.
[citest]
[citest]
[citest]
[citest]
[citest]
[citest pending]
[citest bad]
[citest pending]
[citest pending]
[citest pending]
[citest pending]