Revert "Use stat module instead of shell"

pull/371/head
Michael Sambol 2015-08-07 00:07:51 -05:00
parent 31ea5b49e6
commit c187e1ff83
4 changed files with 19 additions and 19 deletions

View File

@ -284,13 +284,13 @@
when: migration_completed.stat.exists == False when: migration_completed.stat.exists == False
- name: Check if sysvinit - name: Check if sysvinit
stat: path=/var/lib/ceph/osd/ceph-*/sysvinit shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
register: osdsysvinit register: osdsysvinit
failed_when: false failed_when: false
changed_when: False changed_when: False
- name: Check if upstart - name: Check if upstart
stat: path=/var/lib/ceph/osd/ceph-*/upstart shell: stat /var/lib/ceph/osd/ceph-*/upstart
register: osdupstart register: osdupstart
failed_when: false failed_when: false
changed_when: False changed_when: False
@ -329,14 +329,14 @@
service: > service: >
name=ceph-osd-all name=ceph-osd-all
state=stopped state=stopped
when: osdupstart.stat.exists and migration_completed.stat.exists == False when: osdupstart.rc == 0 and migration_completed.stat.exists == False
- name: Gracefully stop the OSDs (Sysvinit) - name: Gracefully stop the OSDs (Sysvinit)
service: > service: >
name=ceph name=ceph
state=stopped state=stopped
args=mon args=mon
when: osdsysvinit.stat.exists and migration_completed.stat.exists == False when: osdsysvinit.rc == 0 and migration_completed.stat.exists == False
- name: Wait for the OSDs to be down - name: Wait for the OSDs to be down
local_action: > local_action: >

View File

@ -5,63 +5,63 @@
- name: restart ceph mons - name: restart ceph mons
command: service ceph restart mon command: service ceph restart mon
when: when:
socket.stat.exists and socket.rc == 0 and
ansible_distribution != 'Ubuntu' and ansible_distribution != 'Ubuntu' and
mon_group_name in group_names mon_group_name in group_names
- name: restart ceph mons on ubuntu - name: restart ceph mons on ubuntu
command: restart ceph-mon-all command: restart ceph-mon-all
when: when:
socket.stat.exists and socket.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
mon_group_name in group_names mon_group_name in group_names
- name: restart ceph osds - name: restart ceph osds
command: service ceph restart osd command: service ceph restart osd
when: when:
socket.stat.exists and socket.rc == 0 and
ansible_distribution != 'Ubuntu' and ansible_distribution != 'Ubuntu' and
osd_group_name in group_names osd_group_name in group_names
- name: restart ceph osds on ubuntu - name: restart ceph osds on ubuntu
command: restart ceph-osd-all command: restart ceph-osd-all
when: when:
socket.stat.exists and socket.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
osd_group_name in group_names osd_group_name in group_names
- name: restart ceph mdss on ubuntu - name: restart ceph mdss on ubuntu
command: restart ceph-mds-all command: restart ceph-mds-all
when: when:
socket.stat.exists and socket.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
mds_group_name in group_names mds_group_name in group_names
- name: restart ceph mdss - name: restart ceph mdss
command: service ceph restart mds command: service ceph restart mds
when: when:
socket.stat.exists and socket.rc == 0 and
ansible_distribution != 'Ubuntu' and ansible_distribution != 'Ubuntu' and
mds_group_name in group_names mds_group_name in group_names
- name: restart ceph rgws on ubuntu - name: restart ceph rgws on ubuntu
command: restart ceph-all command: restart ceph-all
when: when:
socketrgw.stat.exists and socketrgw.rc == 0 and
ansible_distribution == 'Ubuntu' and ansible_distribution == 'Ubuntu' and
rgw_group_name in group_names rgw_group_name in group_names
- name: restart ceph rgws - name: restart ceph rgws
command: /etc/init.d/radosgw restart command: /etc/init.d/radosgw restart
when: when:
socketrgw.stat.exists and socketrgw.rc == 0 and
ansible_distribution != 'Ubuntu' and ansible_distribution != 'Ubuntu' and
rgw_group_name in group_names rgw_group_name in group_names
- name: restart ceph rgws on red hat - name: restart ceph rgws on red hat
command: /etc/init.d/ceph-radosgw restart command: /etc/init.d/ceph-radosgw restart
when: when:
socketrgw.stat.exists and socketrgw.rc == 0 and
ansible_os_family == 'RedHat' and ansible_os_family == 'RedHat' and
rgw_group_name in group_names rgw_group_name in group_names

View File

@ -38,13 +38,13 @@
rgw_group_name in group_names rgw_group_name in group_names
- name: check for a ceph socket - name: check for a ceph socket
stat: path=/var/run/ceph/*.asok shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
changed_when: false changed_when: false
failed_when: false failed_when: false
register: socket register: socket
- name: check for a rados gateway socket - name: check for a rados gateway socket
stat: path={{ rbd_client_admin_socket_path }}*.asok shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1"
changed_when: false changed_when: false
failed_when: false failed_when: false
register: socketrgw register: socketrgw

View File

@ -90,12 +90,12 @@
post_tasks: post_tasks:
- name: Check if sysvinit - name: Check if sysvinit
stat: path=/var/lib/ceph/osd/ceph-*/sysvinit shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
register: osdsysvinit register: osdsysvinit
failed_when: false failed_when: false
- name: Check if upstart - name: Check if upstart
stat: path=/var/lib/ceph/osd/ceph-*/upstart shell: stat /var/lib/ceph/osd/ceph-*/upstart
register: osdupstart register: osdupstart
failed_when: false failed_when: false
@ -103,14 +103,14 @@
service: > service: >
name=ceph-osd-all name=ceph-osd-all
state=restarted state=restarted
when: osdupstart.stat.exists when: osdupstart.rc == 0
- name: Gracefully stop the OSDs (Sysvinit) - name: Gracefully stop the OSDs (Sysvinit)
service: > service: >
name=ceph name=ceph
state=restarted state=restarted
args=osd args=osd
when: osdsysvinit.stat.exists when: osdsysvinit.rc == 0
- name: Waiting for clean PGs... - name: Waiting for clean PGs...
shell: > shell: >