Change restart-check to started/restarted check

role_nftables
Ruakij 2 years ago
parent a92409c56f
commit 093612f3a7

@ -6,8 +6,7 @@
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-agent name: k3s-agent
state: 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"

@ -4,11 +4,11 @@
register: command register: command
changed_when: "'No change detected' not in command.stdout" changed_when: "'No change detected' not in command.stdout"
- 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
state: 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" when: "inventory_hostname == groups['kubernetes'][0]"
- name: Waiting for K3s-server to accept connections - name: Waiting for K3s-server to accept connections
ansible.builtin.wait_for: ansible.builtin.wait_for:
@ -26,11 +26,11 @@
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
state: 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" when: "inventory_hostname != groups['kubernetes'][0]"
- name: Waiting for K3s-server to accept connections on other nodes - name: Waiting for K3s-server to accept connections on other nodes
ansible.builtin.wait_for: ansible.builtin.wait_for:

Loading…
Cancel
Save