mirror of
https://github.com/PyratLabs/ansible-role-k3s
synced 2024-12-12 14:00:18 +01:00
fix: systemd env vars and openrc service file
This commit is contained in:
parent
e6cb2a91e8
commit
6f1cb8e904
4 changed files with 9 additions and 7 deletions
|
@ -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:
|
||||
|
|
|
@ -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 }}"
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue