From 5aa3d3729f04fbe51ea75fbad442c57a34e49586 Mon Sep 17 00:00:00 2001 From: Leseb Date: Wed, 29 Jul 2015 19:14:04 +0200 Subject: [PATCH] Revert "Failed_when and stat module" --- cluster-os-migration.yml | 10 +++++----- contrib/splitup.yml | 2 +- purge-cluster.yml | 6 +++--- roles/ceph-common/tasks/main.yml | 8 ++++---- roles/ceph-common/tasks/misc/system_tuning.yml | 6 +++--- .../prerequisite_rh_storage_cdn_install.yml | 6 +++--- roles/ceph-mds/tasks/docker/fetch_configs.yml | 2 +- roles/ceph-mon/tasks/docker.yml | 2 +- roles/ceph-mon/tasks/docker/fetch_configs.yml | 2 +- roles/ceph-mon/tasks/openstack_config.yml | 2 +- roles/ceph-osd/tasks/activate_osds.yml | 4 ++-- roles/ceph-osd/tasks/check_devices.yml | 6 +++--- roles/ceph-osd/tasks/docker/fetch_configs.yml | 2 +- roles/ceph-osd/tasks/osd_fragment.yml | 4 ++-- roles/ceph-osd/tasks/scenarios/docker.yml | 2 +- roles/ceph-restapi/tasks/start_restapi.yml | 2 +- roles/ceph-rgw/tasks/installs/install_debian.yml | 2 +- roles/ceph-rgw/tasks/start_radosgw.yml | 2 +- rolling_update.yml | 4 ++-- 19 files changed, 37 insertions(+), 37 deletions(-) diff --git a/cluster-os-migration.yml b/cluster-os-migration.yml index 9053dfd91..f96f9ce75 100644 --- a/cluster-os-migration.yml +++ b/cluster-os-migration.yml @@ -21,7 +21,7 @@ stat: > path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/migration_completed register: migration_completed - failed_when: false + ignore_errors: True - name: Check for failed run stat: > @@ -248,7 +248,7 @@ stat: > path=/var/lib/ceph/migration_completed register: migration_completed - failed_when: false + ignore_errors: True - name: Check for failed run stat: > @@ -286,13 +286,13 @@ - name: Check if sysvinit shell: stat /var/lib/ceph/osd/ceph-*/sysvinit register: osdsysvinit - failed_when: false + ignore_errors: True changed_when: False - name: Check if upstart shell: stat /var/lib/ceph/osd/ceph-*/upstart register: osdupstart - failed_when: false + ignore_errors: True changed_when: False - name: Archive ceph configs @@ -443,7 +443,7 @@ stat: > path=/var/lib/ceph/radosgw/migration_completed register: migration_completed - failed_when: false + ignore_errors: True - name: Check for failed run stat: > diff --git a/contrib/splitup.yml b/contrib/splitup.yml index 18861cf6d..c5f7866c8 100644 --- a/contrib/splitup.yml +++ b/contrib/splitup.yml @@ -50,7 +50,7 @@ tags: update command: > git remote add upstream git@github.com:ceph/ceph-ansible.git - failed_when: false + ignore_errors: yes - name: pulles the newest changes from upstream tags: update diff --git a/purge-cluster.yml b/purge-cluster.yml index 9b84459f7..dbdb1e437 100644 --- a/purge-cluster.yml +++ b/purge-cluster.yml @@ -15,12 +15,12 @@ - name: disk zap command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }} with_items: devices - failed_when: false + ignore_errors: true - name: disk zap command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }} with_items: devices - failed_when: false + ignore_errors: true - name: call partprobe command: partprobe @@ -31,7 +31,7 @@ - name: remove osd data shell: rm -rf /var/lib/ceph/osd/*/* - failed_when: false + ignore_errors: true - name: purge remaining data command: ceph-deploy purgedata {{ ansible_fqdn }} diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index aacd96092..c390da93d 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -26,15 +26,15 @@ when: ansible_os_family == 'Debian' - 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 - failed_when: false + ignore_errors: true register: 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 - failed_when: false + ignore_errors: true register: socketrgw - name: create a local fetch directory if it doesn't exist diff --git a/roles/ceph-common/tasks/misc/system_tuning.yml b/roles/ceph-common/tasks/misc/system_tuning.yml index fbd10170b..8717a6ce6 100644 --- a/roles/ceph-common/tasks/misc/system_tuning.yml +++ b/roles/ceph-common/tasks/misc/system_tuning.yml @@ -2,18 +2,18 @@ - name: disable osd directory parsing by updatedb command: updatedb -e /var/lib/ceph changed_when: false - failed_when: false + ignore_errors: true - name: disable transparent hugepage command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled" changed_when: false - failed_when: false + ignore_errors: true when: disable_transparent_hugepage - name: disable swap command: swapoff -a changed_when: false - failed_when: false + ignore_errors: true when: disable_swap - name: apply operating system tuning diff --git a/roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_cdn_install.yml b/roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_cdn_install.yml index 1879f38bb..cfc3d245d 100644 --- a/roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_cdn_install.yml +++ b/roles/ceph-common/tasks/pre_requisites/prerequisite_rh_storage_cdn_install.yml @@ -7,7 +7,7 @@ - name: check if the red hat storage monitor repo is already present shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-mon-rpms changed_when: false - failed_when: false + ignore_errors: true register: rh_storage_mon_repo when: mon_group_name in group_names @@ -21,7 +21,7 @@ - name: check if the red hat storage osd repo is already present shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-osd-rpms changed_when: false - failed_when: false + ignore_errors: true register: rh_storage_osd_repo when: osd_group_name in group_names @@ -35,7 +35,7 @@ - name: check if the red hat storage rados gateway repo is already present shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-tools-rpms changed_when: false - failed_when: false + ignore_errors: true register: rh_storage_rgw_repo when: rgw_group_name in group_names diff --git a/roles/ceph-mds/tasks/docker/fetch_configs.yml b/roles/ceph-mds/tasks/docker/fetch_configs.yml index 68c130a72..06c5693dc 100644 --- a/roles/ceph-mds/tasks/docker/fetch_configs.yml +++ b/roles/ceph-mds/tasks/docker/fetch_configs.yml @@ -13,7 +13,7 @@ with_items: ceph_config_keys changed_when: false sudo: false - failed_when: false + ignore_errors: true register: statconfig - name: try to fetch ceph config and keys diff --git a/roles/ceph-mon/tasks/docker.yml b/roles/ceph-mon/tasks/docker.yml index a8fdb9fcf..74f0d4983 100644 --- a/roles/ceph-mon/tasks/docker.yml +++ b/roles/ceph-mon/tasks/docker.yml @@ -30,7 +30,7 @@ with_items: ceph_config_keys changed_when: false sudo: false - failed_when: false + ignore_errors: true register: statconfig - name: try to fetch ceph config and keys diff --git a/roles/ceph-mon/tasks/docker/fetch_configs.yml b/roles/ceph-mon/tasks/docker/fetch_configs.yml index e9f146edb..71f4b6fc3 100644 --- a/roles/ceph-mon/tasks/docker/fetch_configs.yml +++ b/roles/ceph-mon/tasks/docker/fetch_configs.yml @@ -15,7 +15,7 @@ with_items: ceph_config_keys changed_when: false sudo: false - failed_when: false + ignore_errors: true register: statconfig - name: try to fetch ceph config and keys diff --git a/roles/ceph-mon/tasks/openstack_config.yml b/roles/ceph-mon/tasks/openstack_config.yml index c05d244a6..58b46fd36 100644 --- a/roles/ceph-mon/tasks/openstack_config.yml +++ b/roles/ceph-mon/tasks/openstack_config.yml @@ -7,7 +7,7 @@ - "{{ openstack_nova_pool }}" - "{{ openstack_cinder_backup_pool }}" changed_when: false - failed_when: false + ignore_errors: true - name: create openstack keys command: > diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index d6becc9be..d638c2a9b 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -9,7 +9,7 @@ - ispartition.results - devices changed_when: false - failed_when: false + ignore_errors: true when: item.0.rc == 0 and item.1.rc != 0 @@ -21,7 +21,7 @@ - ispartition.results - devices changed_when: false - failed_when: false + ignore_errors: true when: item.0.rc == 0 - include: osd_fragment.yml diff --git a/roles/ceph-osd/tasks/check_devices.yml b/roles/ceph-osd/tasks/check_devices.yml index 4f5b60a52..ab1795914 100644 --- a/roles/ceph-osd/tasks/check_devices.yml +++ b/roles/ceph-osd/tasks/check_devices.yml @@ -2,18 +2,18 @@ # NOTE (leseb): current behavior of ceph-disk is to fail when the device is mounted "stderr: ceph-disk: Error: Device is mounted: /dev/sdb1" # the return code is 1, which makes sense, however ideally if ceph-disk will detect a ceph partition # it should exist we rc=0 and don't do anything unless we do something like --force -# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "failed_when: false" +# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "ignore_errors: true" # I believe it's safer - name: check if the device is a partition or a disk shell: "echo '{{ item }}' | egrep '/dev/(([a-z]{3,4}[0-9]$)|(cciss/c[0-9]{1}d[0-9]{1}p[0-9]$))'" with_items: devices changed_when: false - failed_when: false + ignore_errors: true register: ispartition - name: if partition named 'ceph' exists shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'" with_items: devices changed_when: false - failed_when: false + ignore_errors: true register: parted diff --git a/roles/ceph-osd/tasks/docker/fetch_configs.yml b/roles/ceph-osd/tasks/docker/fetch_configs.yml index e241c5da4..c4f00d47d 100644 --- a/roles/ceph-osd/tasks/docker/fetch_configs.yml +++ b/roles/ceph-osd/tasks/docker/fetch_configs.yml @@ -10,7 +10,7 @@ with_items: ceph_config_keys changed_when: false sudo: false - failed_when: false + ignore_errors: true register: statconfig - name: try to fetch ceph config and keys diff --git a/roles/ceph-osd/tasks/osd_fragment.yml b/roles/ceph-osd/tasks/osd_fragment.yml index 5bbaf9c73..9c66da05c 100644 --- a/roles/ceph-osd/tasks/osd_fragment.yml +++ b/roles/ceph-osd/tasks/osd_fragment.yml @@ -3,14 +3,14 @@ shell: "df | grep {{ item }} | awk '{print $6}'" with_items: devices changed_when: false - failed_when: false + ignore_errors: true register: osd_path - name: get osd id command: cat {{ item.stdout }}/whoami with_items: osd_path.results changed_when: false - failed_when: false + ignore_errors: true register: osd_id - name: create a ceph fragment and assemble directory diff --git a/roles/ceph-osd/tasks/scenarios/docker.yml b/roles/ceph-osd/tasks/scenarios/docker.yml index fa934b770..a9e7d0f64 100644 --- a/roles/ceph-osd/tasks/scenarios/docker.yml +++ b/roles/ceph-osd/tasks/scenarios/docker.yml @@ -18,7 +18,7 @@ stat: > path={{ item }} with_items: ceph_config_keys - failed_when: false + ignore_errors: true register: statconfig - name: try to fetch ceph config and keys diff --git a/roles/ceph-restapi/tasks/start_restapi.yml b/roles/ceph-restapi/tasks/start_restapi.yml index 18a7f5864..0aecd90d6 100644 --- a/roles/ceph-restapi/tasks/start_restapi.yml +++ b/roles/ceph-restapi/tasks/start_restapi.yml @@ -2,7 +2,7 @@ - name: check if ceph rest api is already started shell: "pgrep ceph-rest-api" changed_when: false - failed_when: false + ignore_errors: true register: restapi_status - name: start ceph rest api diff --git a/roles/ceph-rgw/tasks/installs/install_debian.yml b/roles/ceph-rgw/tasks/installs/install_debian.yml index 190539401..6fb23da63 100644 --- a/roles/ceph-rgw/tasks/installs/install_debian.yml +++ b/roles/ceph-rgw/tasks/installs/install_debian.yml @@ -131,7 +131,7 @@ - a2ensite rgw.conf - a2dissite *default changed_when: false - failed_when: false + ignore_errors: true notify: - restart apache2 diff --git a/roles/ceph-rgw/tasks/start_radosgw.yml b/roles/ceph-rgw/tasks/start_radosgw.yml index 2301b4974..b9c34cc1b 100644 --- a/roles/ceph-rgw/tasks/start_radosgw.yml +++ b/roles/ceph-rgw/tasks/start_radosgw.yml @@ -2,7 +2,7 @@ - name: check if rgw is started command: /etc/init.d/radosgw status register: rgwstatus - failed_when: false + ignore_errors: true - name: start rgw command: /etc/init.d/radosgw start diff --git a/rolling_update.yml b/rolling_update.yml index eb9c12792..5465d3ebe 100644 --- a/rolling_update.yml +++ b/rolling_update.yml @@ -92,12 +92,12 @@ - name: Check if sysvinit shell: stat /var/lib/ceph/osd/ceph-*/sysvinit register: osdsysvinit - failed_when: false + ignore_errors: True - name: Check if upstart shell: stat /var/lib/ceph/osd/ceph-*/upstart register: osdupstart - failed_when: false + ignore_errors: True - name: Gracefully stop the OSDs (Upstart) service: >