Merge branch 'role_kubernetes-k3s'
commit
753f456ef3
@ -1,13 +1,12 @@
|
|||||||
- name: Install K3s agent
|
- name: Install K3s agent
|
||||||
command: /root/k3s_install.sh {{ type }}
|
command: /root/k3s_install.sh {{ type }}
|
||||||
register: command
|
register: command
|
||||||
changed_when: "'No change detected' in command.stdout"
|
changed_when: "'No change detected' not in command.stdout"
|
||||||
until: "command is not failed"
|
until: "command is not failed"
|
||||||
retries: 2
|
retries: 2
|
||||||
delay: 10
|
delay: 10
|
||||||
|
|
||||||
- name: Restart when config changed, but install already done
|
- name: Make sure service is started / restarted on config change
|
||||||
service:
|
service:
|
||||||
name: k3s
|
name: k3s-agent
|
||||||
status: restarted
|
state: "{{ 'restarted' if not command.changed and config.changed else 'started' }}"
|
||||||
when: "inventory_hostname != groups['kubernetes'][0] and not command.changed and config.changed"
|
|
||||||
|
Loading…
Reference in New Issue