mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-28 03:32:41 +01:00
Compare commits
5 Commits
77f4c11118
...
55a314b882
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55a314b882 | ||
|
|
edf0c9eebd | ||
|
|
ef8fe53062 | ||
|
|
83d4ee27fd | ||
|
|
a2bfc6c0b1 |
@@ -1,8 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Create k3s.service.d directory
|
||||
- name: Create k3s-node.service.d directory
|
||||
file:
|
||||
path: '{{ systemd_dir }}/k3s.service.d'
|
||||
path: '{{ systemd_dir }}/k3s-node.service.d'
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
@@ -12,7 +12,7 @@
|
||||
- name: Copy K3s http_proxy conf file
|
||||
template:
|
||||
src: "http_proxy.conf.j2"
|
||||
dest: "{{ systemd_dir }}/k3s.service.d/http_proxy.conf"
|
||||
dest: "{{ systemd_dir }}/k3s-node.service.d/http_proxy.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
@@ -6,6 +6,13 @@
|
||||
state: stopped
|
||||
failed_when: false
|
||||
|
||||
# k3s-init won't work if the port is already in use
|
||||
- name: Stop k3s
|
||||
systemd:
|
||||
name: k3s
|
||||
state: stopped
|
||||
failed_when: false
|
||||
|
||||
- name: Clean previous runs of k3s-init # noqa command-instead-of-module
|
||||
# The systemd module does not support "reset-failed", so we need to resort to command.
|
||||
command: systemctl reset-failed k3s-init
|
||||
@@ -29,7 +36,7 @@
|
||||
-p Restart=on-failure \
|
||||
--unit=k3s-init \
|
||||
k3s server {{ server_init_args }}"
|
||||
creates: "{{ systemd_dir }}/k3s.service"
|
||||
creates: "{{ systemd_dir }}/k3s-init.service"
|
||||
|
||||
- name: Verification
|
||||
when: not ansible_check_mode
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
name: "{{ item }}"
|
||||
state: absent
|
||||
with_items:
|
||||
- "{{ systemd_dir }}/k3s.service.d/http_proxy.conf"
|
||||
- "{{ systemd_dir }}/k3s.service.d"
|
||||
- "{{ systemd_dir }}/k3s-node.service.d/http_proxy.conf"
|
||||
- "{{ systemd_dir }}/k3s-node.service.d"
|
||||
when: proxy_env is defined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user