timesync icon indicating copy to clipboard operation
timesync copied to clipboard

[WIP] Implement idempotency & checkmode testing

Open i386x opened this issue 4 years ago • 17 comments

Use linux-system-roles.meta_test role to implement idempotency and checkmode testing.

i386x avatar Feb 16 '21 12:02 i386x

[citest]

i386x avatar Feb 23 '21 14:02 i386x

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.

richm avatar Feb 23 '21 21:02 richm

[citest]

i386x avatar Mar 02 '21 14:03 i386x

[citest]

jharuda avatar Mar 03 '21 08:03 jharuda

@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.

i386x avatar Mar 03 '21 09:03 i386x

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.

i386x avatar Mar 03 '21 18:03 i386x

[citest]

i386x avatar Mar 16 '21 17:03 i386x

[citest]

i386x avatar Mar 16 '21 19:03 i386x

[citest]

i386x avatar Mar 16 '21 22:03 i386x

[citest]

i386x avatar Mar 30 '21 22:03 i386x

[citest]

jharuda avatar Apr 09 '21 17:04 jharuda

[citest pending]

richm avatar May 04 '21 19:05 richm

[citest bad]

richm avatar May 04 '21 19:05 richm

[citest pending]

richm avatar May 04 '21 23:05 richm

[citest pending]

richm avatar Oct 11 '21 20:10 richm

[citest pending]

richm avatar Oct 11 '21 21:10 richm

[citest pending]

richm avatar Oct 20 '21 15:10 richm