diff --git a/handlers/main.yml b/handlers/main.yml index c303160..0d2100f 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,7 +1,4 @@ --- - name: Restart NeoFS IR service - ansible.builtin.systemd: - name: "neofs-ir{{ neofs_ir__instance }}.service" - state: 'restarted' - daemon_reload: yes + ansible.builtin.include_tasks: 'restart.yml' diff --git a/handlers/restart.yml b/handlers/restart.yml new file mode 100644 index 0000000..68e8baf --- /dev/null +++ b/handlers/restart.yml @@ -0,0 +1,16 @@ +--- + +- name: Restart NeoFS IR systemd service + ansible.builtin.systemd: + name: "neofs-ir{{ neofs_ir__instance }}.service" + state: 'restarted' + daemon_reload: yes + +- name: Waiting for node up + ansible.builtin.shell: + cmd: "{{ neofs_ir__cli_bin_path }} control healthcheck -c {{ neofs_ir__control_api_config_path }} --ir" + changed_when: False + register: _neofs_ir_check_result + until: _neofs_ir_check_result.rc == 0 + retries: 10 + delay: 30 diff --git a/tasks/healthcheck.yml b/tasks/healthcheck.yml index 80211eb..b792704 100644 --- a/tasks/healthcheck.yml +++ b/tasks/healthcheck.yml @@ -7,12 +7,3 @@ owner: 'root' group: "{{ neofs_ir__group }}" mode: '0640' - -- name: Waiting for node up - ansible.builtin.shell: | - {{ neofs_ir__cli_bin_path }} control healthcheck -c {{ neofs_ir__control_api_config_path }} --ir - changed_when: False - register: _neofs_ir_check_result - until: _neofs_ir_check_result.rc == 0 - retries: 10 - delay: 30