generated from dmitriysafronov/ansible_role-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dmitriy Safronov <zimniy@cyberbrain.pw>
- Loading branch information
1 parent
fa7a710
commit b1c8875
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# ansible_role-template | ||
|
||
Create systemd dependency between k3s and keepalived |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
|
||
arkk3s_systemd_dir: "/etc/systemd/system" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
|
||
- name: Restart service keepalived | ||
ansible.builtin.systemd: | ||
state: restarted | ||
enabled: true | ||
daemon_reload: true | ||
name: keepalived |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
|
||
- name: Create keepalived service override dir | ||
ansible.builtin.file: | ||
path: "{{ arkk3s_systemd_dir }}/keepalived.service.d" | ||
state: directory | ||
mode: '0755' | ||
|
||
- name: Add dependency to keepalived service | ||
ansible.builtin.copy: | ||
content: | | ||
[Unit] | ||
Requisite=k3s.service | ||
After=k3s.service | ||
[Install] | ||
WantedBy=k3s.service | ||
dest: "{{ arkk3s_systemd_dir }}/keepalived.service.d/k3s.conf" | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
notify: Restart service keepalived |