You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understood the structure correctly, the facts.yml playbook starts with bootstrapping the hosts for Ansible by executing the roles kubespray-defaults and bootstrap-os on the relevant hosts.
Inside the kubespray-defaults role, the gathering of facts is skipped if the bootstrap-os role is contained in the current play's imported roles (to prevent e.g. Ansible connections issues due to an incorrect BIN_DIR and therefore Python interpreter path which is yet to be set correctly inside the bootstrap-os role).
However, when using Kubespray as a collection, the ansible_play_role_names variable which contains the imported, active roles will have the collection name prepended before the role name (e.g. kubernetes_sigs.kubespray.bootstrap-os) and therefore invalidate the mentioned check, possibly leading to errors due to an attempt at gathering facts before the OS-specific configuration is bootstrapped correctly.
While the aforementioned Python interpreter issue can be worked around by setting the path manually, I think it would be a good idea to either adjust the check to also work with absolute (i.e. including the collection name) role references, or somehow force Ansible to always use relative role references (not sure this is possible). I hope my description is sufficient to reproduce the issue even without the usual environment information. I am using Kubespray installed via collection from the master branch.
The text was updated successfully, but these errors were encountered:
As long as the check is changed in such a way that both variants are handled correctly I see no issue for using kubespray the normal way. Just replacing the check would likely break it though, yes.
If I understood the structure correctly, the
facts.yml
playbook starts with bootstrapping the hosts for Ansible by executing the roleskubespray-defaults
andbootstrap-os
on the relevant hosts.Inside the
kubespray-defaults
role, the gathering of facts is skipped if thebootstrap-os
role is contained in the current play's imported roles (to prevent e.g. Ansible connections issues due to an incorrectBIN_DIR
and therefore Python interpreter path which is yet to be set correctly inside thebootstrap-os
role).However, when using Kubespray as a collection, the
ansible_play_role_names
variable which contains the imported, active roles will have the collection name prepended before the role name (e.g.kubernetes_sigs.kubespray.bootstrap-os
) and therefore invalidate the mentioned check, possibly leading to errors due to an attempt at gathering facts before the OS-specific configuration is bootstrapped correctly.While the aforementioned Python interpreter issue can be worked around by setting the path manually, I think it would be a good idea to either adjust the check to also work with absolute (i.e. including the collection name) role references, or somehow force Ansible to always use relative role references (not sure this is possible). I hope my description is sufficient to reproduce the issue even without the usual environment information. I am using Kubespray installed via collection from the master branch.
The text was updated successfully, but these errors were encountered: