Skip to content

Conversation

@KalleDK
Copy link

@KalleDK KalleDK commented Oct 21, 2025

Ensure required facts are checked in a sorted manner.
When comparing them unsorted they do not match like below

- debug:
    msg: "{{ ansible_facts.keys() | list | intersect(__sudo_required_facts) }}"
- debug:
    msg: "{{ __sudo_required_facts }}"
TASK [sudo : debug] ***************************************************************************************************************************************************************************
ok: [cloud01] => {
    "msg": [
        "distribution_major_version",
        "system",
        "distribution",
        "distribution_version",
        "os_family"
    ]
}

TASK [sudo : debug] ***************************************************************************************************************************************************************************
ok: [cloud01] => {
    "msg": [
        "system",
        "os_family",
        "distribution",
        "distribution_major_version",
        "distribution_version"
    ]
}

Ensure required facts are checked in a sorted manner.
@richm
Copy link
Contributor

richm commented Oct 21, 2025

or, if you want to skip the sort, you can use difference instead, as we did in the system roles - see linux-system-roles/storage#374

@KalleDK
Copy link
Author

KalleDK commented Oct 21, 2025

@richm thanks - that feels better imho

@richm
Copy link
Contributor

richm commented Oct 22, 2025

lgtm

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.

2 participants