2019-10-10 01:58:33 +08:00
|
|
|
---
|
|
|
|
- name: set _nfs_handler_called before restart
|
|
|
|
set_fact:
|
|
|
|
_nfs_handler_called: True
|
|
|
|
|
|
|
|
- name: copy nfs restart script
|
|
|
|
template:
|
|
|
|
src: restart_nfs_daemon.sh.j2
|
2019-11-29 01:28:53 +08:00
|
|
|
dest: "{{ tmpdirpath.path }}/restart_nfs_daemon.sh"
|
2019-10-10 01:58:33 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0750
|
2021-12-30 22:08:08 +08:00
|
|
|
when: tmpdirpath.path is defined
|
2019-10-10 01:58:33 +08:00
|
|
|
|
|
|
|
- name: restart ceph nfs daemon(s)
|
2019-11-29 01:28:53 +08:00
|
|
|
command: /usr/bin/env bash {{ hostvars[item]['tmpdirpath']['path'] }}/restart_nfs_daemon.sh
|
2019-10-10 01:58:33 +08:00
|
|
|
when:
|
2019-12-19 18:29:41 +08:00
|
|
|
- hostvars[item]['handler_nfs_status'] | default(False) | bool
|
2019-10-10 01:58:33 +08:00
|
|
|
- hostvars[item]['_nfs_handler_called'] | default(False) | bool
|
2021-12-30 22:08:08 +08:00
|
|
|
- hostvars[item].tmpdirpath.path is defined
|
2019-10-10 01:58:33 +08:00
|
|
|
with_items: "{{ groups[nfs_group_name] }}"
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: set _nfs_handler_called after restart
|
|
|
|
set_fact:
|
|
|
|
_nfs_handler_called: False
|