Prior to this patch, the first match was winning and the playbook wasn't
doing any difference both "restart ceph", adding a distro filtrer fixes
this.
Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
- name: "update apt cache"
action: apt update-cache=yes
-- name: "restart ceph"
+- name: "restart ceph ubuntu"
shell: service ceph restart ; service ceph-osd-all restart
- when: socket.rc == 0 and ansible_distribution == 'Ubuntu'
+ when: socket.rc == 0
-- name: "restart ceph"
+- name: "restart ceph debian redhat"
command: service ceph restart
- when: socket.rc == 0 and ansible_distribution == 'Debian' or ansible_os_family == 'RedHat'
+ when: socket.rc == 0
- name: Generate Ceph configuration file
template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
- notify: restart ceph
+ notify: restart ceph ubuntu
+ when: ansible_distribution == 'Ubuntu'
+
+- name: Generate Ceph configuration file
+ template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
+ notify: restart ceph debian redhat
+ when: ansible_distribution == 'Debian' or ansible_os_family == 'RedHat'
- name: Disable OSD directory parsing by updatedb
command: updatedb -e /var/lib/ceph
- name: Generate Ceph configuration file
template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644
- notify: restart ceph
+ notify: restart ceph debian redhat
- name: Disable OSD directory parsing by updatedb
command: updatedb -e /var/lib/ceph