Skip to content
Snippets Groups Projects
Unverified Commit 1067f630 authored by Zero King's avatar Zero King Committed by GitHub
Browse files

Add service environment variables to all hosts (#416)


Signed-off-by: default avatarZero King <l2dy@icloud.com>
parent f1d53c65
Branches
Tags
No related merge requests found
...@@ -54,6 +54,13 @@ ...@@ -54,6 +54,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
token: "{{ hostvars[groups[server_group][0]].token }}" 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 - name: Delete any existing token from the environment if different from the new one
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
state: absent state: absent
......
...@@ -211,6 +211,13 @@ ...@@ -211,6 +211,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
token: "{{ hostvars[groups[server_group][0]].token }}" 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 - name: Delete any existing token from the environment if different from the new one
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
state: absent state: absent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment