Create registries.yaml if k3s_registries.mirrors or k3s_registries.configs are not None
Summary
The task Ensure containerd registries is run when k3s_registries is defined, but k3s_registries is always defined in defaults. This then creates a yaml file with null values for configs and mirrors :
It can be problematic if there is already a registries.yaml file present and it's overwritten by the role.
This MR adds a two conditions when importing the task. The task is imported only if k3s_registries.mirrors or k3s_registries.configs are not None. Both values are set to None by default.
Fixes #205
Issue type
Bugfix
Test instructions
If registries variable is not set (in the inventory or in a playbook) then the task Ensure containerd registries file exists is skipped and {{ k3s_config_dir }}/registries.yaml is not created.
Create registries.yaml if k3s_registries.mirrors or k3s_registries.configs are not None
Summary
The task
Ensure containerd registries
is run whenk3s_registries is defined
, butk3s_registries
is always defined in defaults. This then creates a yaml file with null values for configs and mirrors :It can be problematic if there is already a
registries.yaml
file present and it's overwritten by the role.This MR adds a two conditions when importing the task. The task is imported only if
k3s_registries.mirrors
ork3s_registries.configs
are not None. Both values are set to None by default.Fixes #205
Issue type
Test instructions
If
registries
variable is not set (in the inventory or in a playbook) then the taskEnsure containerd registries file exists
is skipped and{{ k3s_config_dir }}/registries.yaml
is not created.Acceptance Criteria
Additional Information