Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
K3S Ansible
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
K3S Ansible
Commits
1067f630
Unverified
Commit
1067f630
authored
1 month ago
by
Zero King
Committed by
GitHub
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Add service environment variables to all hosts (#416)
Signed-off-by:
Zero King
<
l2dy@icloud.com
>
parent
f1d53c65
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/k3s_agent/tasks/main.yml
+7
-0
7 additions, 0 deletions
roles/k3s_agent/tasks/main.yml
roles/k3s_server/tasks/main.yml
+7
-0
7 additions, 0 deletions
roles/k3s_server/tasks/main.yml
with
14 additions
and
0 deletions
roles/k3s_agent/tasks/main.yml
+
7
−
0
View file @
1067f630
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
roles/k3s_server/tasks/main.yml
+
7
−
0
View file @
1067f630
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment