| 12345678910111213141516171819202122 |
- - name: Check if volume is running
- command:
- argv:
- - gluster
- - volume
- - status
- - "{{ item }}"
- register: gluster_vol_stopped
- changed_when: "not ('is not started' in gluster_vol_stopped.stderr)"
- failed_when: false
- run_once: true
- loop: "{{ gluster_vol_handler }}"
- listen: gluster_vol_restart
- - name: "Stop {{ gluster_vol_name }}"
- gluster.gluster.gluster_volume:
- state: stopped
- name: "{{ gluster_vol_name }}"
- run_once: true
- loop: "{{ gluster_vol_handler }}"
- when: gluster_vol_stopped.changed
- listen: gluster_vol_restart
-
|