Closed weakcamel closed 3 weeks ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still a problem
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Summary
This role can be run in several modes, including validation (installed, started, stopped, restarted, uninstalled, validated)
If you want to run it first in 'installed' and then 'validated' mode in single playbook, there is a problem with k3s_controller_list variable: on second run it contains duplicate entries and consequently validation fails. That's because Ansible - sadly - doesn't scope the variables properly and they're left behind as-is after a role finishes.
It's not a very common use case, however it would be nice if the role was re-entrant. It's also very easy to achieve - e.g. by setting the
k3s_controller_list
to an empty listjust before it's being appended to in a loop:
https://github.com/PyratLabs/ansible-role-k3s/blob/37fda0a953e83ae802b0997f881a7c8533b77e92/tasks/ensure_pre_configuration.yml#L31
Issue Type
Controller Environment and Configuration
Role version:
Steps to Reproduce
Expected Result
Actual Result
After adding an extra debug task to the role just before this one, I discovered: