Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-3248

sshd role should support running tests with ANSIBLE_GATHERING=explicit

    • None
    • None
    • sst_system_roles
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      +++ This bug was initially created as a clone of Bug #2078999 +++

      +++ This bug was initially created as a clone of Bug #2078989 +++

      Description of problem:
      Some users use `gather_facts: false` in their playbooks, due to performance issues with fact gathering, or other reasons. However, this breaks the metrics role because it requires some sort of facts like `os_family`, `distribution`, etc. to be defined. The role should work if fact gathering is disabled in the playbook.

      NOTE: This may require the user to enable fact caching, or simply not use the metrics role if it is not possible to use fact gathering at all.

      Version-Release number of selected component (if applicable):

      How reproducible:

      Steps to Reproduce:
      1.
      2.
      3.

      Actual results:

      Expected results:

      Additional info:

      — Additional comment from Rich Megginson on 2022-04-26 16:41:29 UTC —

      Ansible by default will always gather facts in playbooks. In order to test, you can use https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-gathering to disable fact gathering by default.

      e.g.

      ANSIBLE_GATHERING=explicit ansible-playbook .... tests/tests_name.yml

      Even though the sshd role should support being run with "gather_facts: false" in the playbook, almost all of the tests fail when using ANSIBLE_GATHERING=explicit, so it is difficult to verify that the role is indeed working with fact gathering disabled.

      If we change all of the tests that fail to use "gather_facts: true", then the tests pass, but we have then masked the problem, and we are not actually verifying that the role will work when customers use "gather_facts: false" in their playbooks.

      I guess the best we can do is ensure that there are at least some non-trivial sshd role tests that can be run with ANSIBLE_GATHERING=explicit that do not just use "gather_facts: true" inside the test.

            rmeggins@redhat.com Richard Megginson
            rmeggins@redhat.com Richard Megginson
            Richard Megginson Richard Megginson
            Robert Fubel Robert Fubel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: