Failed_when instead of ignore_errors

Changed ignore_errors to failed_when so the output doesn't show in
red.
pull/357/head
Michael Sambol 2015-07-28 11:21:15 -05:00
parent 1414287b57
commit e6f22b948c
19 changed files with 35 additions and 35 deletions

View File

@ -21,7 +21,7 @@
stat: >
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/migration_completed
register: migration_completed
ignore_errors: True
failed_when: false
- name: Check for failed run
stat: >
@ -248,7 +248,7 @@
stat: >
path=/var/lib/ceph/migration_completed
register: migration_completed
ignore_errors: True
failed_when: false
- name: Check for failed run
stat: >
@ -286,13 +286,13 @@
- name: Check if sysvinit
shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
register: osdsysvinit
ignore_errors: True
failed_when: false
changed_when: False
- name: Check if upstart
shell: stat /var/lib/ceph/osd/ceph-*/upstart
register: osdupstart
ignore_errors: True
failed_when: false
changed_when: False
- name: Archive ceph configs
@ -443,7 +443,7 @@
stat: >
path=/var/lib/ceph/radosgw/migration_completed
register: migration_completed
ignore_errors: True
failed_when: false
- name: Check for failed run
stat: >

View File

@ -50,7 +50,7 @@
tags: update
command: >
git remote add upstream git@github.com:ceph/ceph-ansible.git
ignore_errors: yes
failed_when: false
- name: pulles the newest changes from upstream
tags: update

View File

@ -15,12 +15,12 @@
- name: disk zap
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
with_items: devices
ignore_errors: true
failed_when: false
- name: disk zap
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
with_items: devices
ignore_errors: true
failed_when: false
- name: call partprobe
command: partprobe
@ -31,7 +31,7 @@
- name: remove osd data
shell: rm -rf /var/lib/ceph/osd/*/*
ignore_errors: true
failed_when: false
- name: purge remaining data
command: ceph-deploy purgedata {{ ansible_fqdn }}

View File

@ -28,13 +28,13 @@
- name: check for a ceph socket
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
changed_when: false
ignore_errors: true
failed_when: false
register: socket
- name: check for a rados gateway socket
shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1"
changed_when: false
ignore_errors: true
failed_when: false
register: socketrgw
- name: create a local fetch directory if it doesn't exist

View File

@ -2,18 +2,18 @@
- name: disable osd directory parsing by updatedb
command: updatedb -e /var/lib/ceph
changed_when: false
ignore_errors: true
failed_when: false
- name: disable transparent hugepage
command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
changed_when: false
ignore_errors: true
failed_when: false
when: disable_transparent_hugepage
- name: disable swap
command: swapoff -a
changed_when: false
ignore_errors: true
failed_when: false
when: disable_swap
- name: apply operating system tuning

View File

@ -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
ignore_errors: true
failed_when: false
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
ignore_errors: true
failed_when: false
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
ignore_errors: true
failed_when: false
register: rh_storage_rgw_repo
when: rgw_group_name in group_names

View File

@ -13,7 +13,7 @@
with_items: ceph_config_keys
changed_when: false
sudo: false
ignore_errors: true
failed_when: false
register: statconfig
- name: try to fetch ceph config and keys

View File

@ -30,7 +30,7 @@
with_items: ceph_config_keys
changed_when: false
sudo: false
ignore_errors: true
failed_when: false
register: statconfig
- name: try to fetch ceph config and keys

View File

@ -15,7 +15,7 @@
with_items: ceph_config_keys
changed_when: false
sudo: false
ignore_errors: true
failed_when: false
register: statconfig
- name: try to fetch ceph config and keys

View File

@ -7,7 +7,7 @@
- "{{ openstack_nova_pool }}"
- "{{ openstack_cinder_backup_pool }}"
changed_when: false
ignore_errors: true
failed_when: false
- name: create openstack keys
command: >

View File

@ -9,7 +9,7 @@
- ispartition.results
- devices
changed_when: false
ignore_errors: true
failed_when: false
when:
item.0.rc == 0 and
item.1.rc != 0
@ -21,7 +21,7 @@
- ispartition.results
- devices
changed_when: false
ignore_errors: true
failed_when: false
when: item.0.rc == 0
- include: osd_fragment.yml

View File

@ -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 "ignore_errors: true"
# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "failed_when: false"
# 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
ignore_errors: true
failed_when: false
register: ispartition
- name: if partition named 'ceph' exists
shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
with_items: devices
changed_when: false
ignore_errors: true
failed_when: false
register: parted

View File

@ -10,7 +10,7 @@
with_items: ceph_config_keys
changed_when: false
sudo: false
ignore_errors: true
failed_when: false
register: statconfig
- name: try to fetch ceph config and keys

View File

@ -3,14 +3,14 @@
shell: "df | grep {{ item }} | awk '{print $6}'"
with_items: devices
changed_when: false
ignore_errors: true
failed_when: false
register: osd_path
- name: get osd id
command: cat {{ item.stdout }}/whoami
with_items: osd_path.results
changed_when: false
ignore_errors: true
failed_when: false
register: osd_id
- name: create a ceph fragment and assemble directory

View File

@ -18,7 +18,7 @@
stat: >
path={{ item }}
with_items: ceph_config_keys
ignore_errors: true
failed_when: false
register: statconfig
- name: try to fetch ceph config and keys

View File

@ -2,7 +2,7 @@
- name: check if ceph rest api is already started
shell: "pgrep ceph-rest-api"
changed_when: false
ignore_errors: true
failed_when: false
register: restapi_status
- name: start ceph rest api

View File

@ -131,7 +131,7 @@
- a2ensite rgw.conf
- a2dissite *default
changed_when: false
ignore_errors: true
failed_when: false
notify:
- restart apache2

View File

@ -2,7 +2,7 @@
- name: check if rgw is started
command: /etc/init.d/radosgw status
register: rgwstatus
ignore_errors: true
failed_when: false
- name: start rgw
command: /etc/init.d/radosgw start

View File

@ -92,12 +92,12 @@
- name: Check if sysvinit
shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
register: osdsysvinit
ignore_errors: True
failed_when: false
- name: Check if upstart
shell: stat /var/lib/ceph/osd/ceph-*/upstart
register: osdupstart
ignore_errors: True
failed_when: false
- name: Gracefully stop the OSDs (Upstart)
service: >