Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement idempotency & checkmode testing #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

i386x
Copy link
Contributor

@i386x i386x commented Feb 16, 2021

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

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

- src: https://github.com/i386x/meta_test
version: ic-role
name: linux-system-roles.meta_test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test was not able to find this role in CI - is requirements.txt being processed by CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I created PR for this: linux-system-roles/test-harness#146

@i386x
Copy link
Contributor Author

i386x commented Feb 23, 2021

[citest]

@richm
Copy link
Collaborator

richm commented Feb 23, 2021

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.

@i386x
Copy link
Contributor Author

i386x commented Mar 2, 2021

[citest]

1 similar comment
@jharuda
Copy link

jharuda commented Mar 3, 2021

[citest]

@i386x
Copy link
Contributor Author

i386x commented Mar 3, 2021

@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
Copy link
Contributor Author

i386x commented Mar 3, 2021

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
Copy link
Contributor Author

i386x commented Mar 16, 2021

[citest]

4 similar comments
@i386x
Copy link
Contributor Author

i386x commented Mar 16, 2021

[citest]

@i386x
Copy link
Contributor Author

i386x commented Mar 16, 2021

[citest]

@i386x
Copy link
Contributor Author

i386x commented Mar 30, 2021

[citest]

@jharuda
Copy link

jharuda commented Apr 9, 2021

[citest]

@richm
Copy link
Collaborator

richm commented May 4, 2021

[citest pending]

@richm
Copy link
Collaborator

richm commented May 4, 2021

[citest bad]

@richm
Copy link
Collaborator

richm commented May 4, 2021

[citest pending]

3 similar comments
@richm
Copy link
Collaborator

richm commented Oct 11, 2021

[citest pending]

@richm
Copy link
Collaborator

richm commented Oct 11, 2021

[citest pending]

@richm
Copy link
Collaborator

richm commented Oct 20, 2021

[citest pending]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants