mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2026-10-23 03:22:03 +02:00
Add service environment variables to all hosts (#416)
Signed-off-by: Zero King <l2dy@icloud.com>
This commit is contained in:
1 parent
f1d53c65e0
commit
1067f630f5
2 files changed
+14
No files matched your search
@@ -54,6 +54,13 @@
|
||||
ansible.builtin.set_fact:
|
||||
token: "{{ hostvars[groups[server_group][0]].token }}"
|
||||
|
||||
- name: Add service environment variables
|
||||
when: extra_service_envs is defined
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ systemd_dir }}/k3s.service.env"
|
||||
line: "{{ item }}"
|
||||
with_items: "{{ extra_service_envs }}"
|
||||
|
||||
- name: Delete any existing token from the environment if different from the new one
|
||||
ansible.builtin.lineinfile:
|
||||
state: absent
|
||||
|
||||
@@ -211,6 +211,13 @@
|
||||
ansible.builtin.set_fact:
|
||||
token: "{{ hostvars[groups[server_group][0]].token }}"
|
||||
|
||||
- name: Add service environment variables
|
||||
when: extra_service_envs is defined
|
||||
ansible.builtin.lineinfile:
|
||||
path: "{{ systemd_dir }}/k3s.service.env"
|
||||
line: "{{ item }}"
|
||||
with_items: "{{ extra_service_envs }}"
|
||||
|
||||
- name: Delete any existing token from the environment if different from the new one
|
||||
ansible.builtin.lineinfile:
|
||||
state: absent
|
||||
|
||||
Reference in new issue
Block a user