diff --git a/molecule/autodeploy/converge.yml b/molecule/autodeploy/converge.yml index f46fa49..6aef998 100644 --- a/molecule/autodeploy/converge.yml +++ b/molecule/autodeploy/converge.yml @@ -4,13 +4,14 @@ become: true vars: molecule_is_test: true - k3s_release_version: latest + k3s_release_version: v1.22 k3s_build_cluster: false + k3s_control_token: 55ba04e5-e17d-4535-9170-3e4245453f4d k3s_install_dir: /opt/k3s/bin - k3s_config_file: /opt/k3s/etc/k3s.yaml - k3s_server: - data-dir: /var/lib/k3s-io - default-local-storage-path: /var/lib/k3s-io/local-storage + k3s_config_file: /opt/k3s/etc/k3s_config.yaml + # k3s_server: + # data-dir: /var/lib/k3s-io + # default-local-storage-path: /var/lib/k3s-io/local-storage k3s_agent: snapshotter: native k3s_server_manifests_templates: diff --git a/molecule/nodeploy/converge.yml b/molecule/nodeploy/converge.yml index eed5687..d016b35 100644 --- a/molecule/nodeploy/converge.yml +++ b/molecule/nodeploy/converge.yml @@ -7,5 +7,6 @@ k3s_server: "{{ lookup('file', 'k3s_server.yml') | from_yaml }}" k3s_agent: "{{ lookup('file', 'k3s_agent.yml') | from_yaml }}" k3s_airgap: true + k3s_release_version: latest roles: - role: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}" diff --git a/templates/k3s.openrc.j2 b/templates/k3s.openrc.j2 index 54bd949..98aa22a 100644 --- a/templates/k3s.openrc.j2 +++ b/templates/k3s.openrc.j2 @@ -25,7 +25,7 @@ command_args="{% filter regex_replace('\s+', ' ') %} {% if k3s_server is defined %} --config {{ k3s_config_file }} {% endif %} - {% if k3s_control_node and not k3s_primary_control_node %} + {% if not k3s_primary_control_node or k3s_control_token is defined %} --token-file {{ k3s_token_location }} {% endif %} {% else %} diff --git a/templates/k3s.service.j2 b/templates/k3s.service.j2 index 77fcd65..fdab38f 100644 --- a/templates/k3s.service.j2 +++ b/templates/k3s.service.j2 @@ -20,7 +20,7 @@ After={{ after_unit }} Type={{ 'notify' if k3s_control_node else 'exec' }} {% if k3s_service_env_vars is defined and k3s_service_env_vars is iterable %} {% for env_var in k3s_service_env_vars %} -Environment={{ env_var }}={{ k3s_service_env_vars[env_var] }} +Environment={{ env_var }}="{{ k3s_service_env_vars[env_var] }}" {% endfor %} {% endif %} {% if k3s_service_env_file is defined and k3s_service_env_file %}