Closed ewenmcneill closed 5 months ago
Closing issue, since using - meta: clear_facts
is an edge case (only necessary in a specific client setup due to conflicting variable names). Given no one else has commented on this, or done anything about it in the last couple of years it's probaby not worth keeping open. (And for the client with the issue, I deployed a work around by forcing - setup:
to run explicitly before including the IPA Client roles.)
Ewen
The
roles/ipaclient/tasks/main.yml
relies on Ansible discovered facts (to figure out which set of variables to load, for packages ot install):https://github.com/freeipa/ansible-freeipa/blob/90e8098bf4ad4272202c7d1a312f699de9b10f5e/roles/ipaclient/tasks/main.yml#L4-L17
which having ensured that those facts have been discovered / are still known.
In particular if included immediately after:
but possibly also if it's included as the only task, so the
include_vars
happens as the very first action, then the various discovered Ansible distribution variables are not available, which results in falling through to including the default variables.The default variables are mostly the same, except for
Debian.yml
, which is used for Ubuntu, so falling through to the default variables "mostly works", except on Debian / Ubuntu, where using the default / RedHat-derived package naming results in:because the actual Ubuntu package is
freeipa-client
, as perDebian.yml
.The work around for this is to force fact (re)discovery immediately:
so that the variables are definitely set. And I'd suggest that be included at the top of at least
roles/ipaclient/tasks/main.yml
before relying on those variables being set. And/or a check on them not being set and afatal:
being generated instead.FTR, I found this issue as fallout of the work around for an earlier issue with
delegate_to
Python interpeter discovery; see https://github.com/freeipa/ansible-freeipa/issues/688#issuecomment-977187355 for more background. (Where- meta: clear_facts
is one of the known work arounds for force thedelegate_to
python interpeter to be re-discovered on older Ansible versions.) For now I've worked around this by adding a- setup:
immediately below my- meta: clear_facts
, so that at the point theipaclient
role is included just the facts from the current target should be known, not the others from previous step'sdelegate_to
hosts.Ewen