mirror of https://github.com/ceph/ceph-ansible.git
Failed_when instead of ignore_errors
Changed ignore_errors to failed_when so the output doesn't show in red.pull/357/head
parent
1414287b57
commit
e6f22b948c
|
@ -21,7 +21,7 @@
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/migration_completed
|
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/migration_completed
|
||||||
register: migration_completed
|
register: migration_completed
|
||||||
ignore_errors: True
|
failed_when: false
|
||||||
|
|
||||||
- name: Check for failed run
|
- name: Check for failed run
|
||||||
stat: >
|
stat: >
|
||||||
|
@ -248,7 +248,7 @@
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/migration_completed
|
path=/var/lib/ceph/migration_completed
|
||||||
register: migration_completed
|
register: migration_completed
|
||||||
ignore_errors: True
|
failed_when: false
|
||||||
|
|
||||||
- name: Check for failed run
|
- name: Check for failed run
|
||||||
stat: >
|
stat: >
|
||||||
|
@ -286,13 +286,13 @@
|
||||||
- name: Check if sysvinit
|
- name: Check if sysvinit
|
||||||
shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
|
shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
|
||||||
register: osdsysvinit
|
register: osdsysvinit
|
||||||
ignore_errors: True
|
failed_when: false
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: Check if upstart
|
- name: Check if upstart
|
||||||
shell: stat /var/lib/ceph/osd/ceph-*/upstart
|
shell: stat /var/lib/ceph/osd/ceph-*/upstart
|
||||||
register: osdupstart
|
register: osdupstart
|
||||||
ignore_errors: True
|
failed_when: false
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: Archive ceph configs
|
- name: Archive ceph configs
|
||||||
|
@ -443,7 +443,7 @@
|
||||||
stat: >
|
stat: >
|
||||||
path=/var/lib/ceph/radosgw/migration_completed
|
path=/var/lib/ceph/radosgw/migration_completed
|
||||||
register: migration_completed
|
register: migration_completed
|
||||||
ignore_errors: True
|
failed_when: false
|
||||||
|
|
||||||
- name: Check for failed run
|
- name: Check for failed run
|
||||||
stat: >
|
stat: >
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
tags: update
|
tags: update
|
||||||
command: >
|
command: >
|
||||||
git remote add upstream git@github.com:ceph/ceph-ansible.git
|
git remote add upstream git@github.com:ceph/ceph-ansible.git
|
||||||
ignore_errors: yes
|
failed_when: false
|
||||||
|
|
||||||
- name: pulles the newest changes from upstream
|
- name: pulles the newest changes from upstream
|
||||||
tags: update
|
tags: update
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
- name: disk zap
|
- name: disk zap
|
||||||
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
|
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
|
||||||
with_items: devices
|
with_items: devices
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
|
|
||||||
- name: disk zap
|
- name: disk zap
|
||||||
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
|
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
|
||||||
with_items: devices
|
with_items: devices
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
|
|
||||||
- name: call partprobe
|
- name: call partprobe
|
||||||
command: partprobe
|
command: partprobe
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
- name: remove osd data
|
- name: remove osd data
|
||||||
shell: rm -rf /var/lib/ceph/osd/*/*
|
shell: rm -rf /var/lib/ceph/osd/*/*
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
|
|
||||||
- name: purge remaining data
|
- name: purge remaining data
|
||||||
command: ceph-deploy purgedata {{ ansible_fqdn }}
|
command: ceph-deploy purgedata {{ ansible_fqdn }}
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
- name: check for a ceph socket
|
- name: check for a ceph socket
|
||||||
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
|
shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: socket
|
register: socket
|
||||||
|
|
||||||
- name: check for a rados gateway socket
|
- name: check for a rados gateway socket
|
||||||
shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1"
|
shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: socketrgw
|
register: socketrgw
|
||||||
|
|
||||||
- name: create a local fetch directory if it doesn't exist
|
- name: create a local fetch directory if it doesn't exist
|
||||||
|
|
|
@ -2,18 +2,18 @@
|
||||||
- name: disable osd directory parsing by updatedb
|
- name: disable osd directory parsing by updatedb
|
||||||
command: updatedb -e /var/lib/ceph
|
command: updatedb -e /var/lib/ceph
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
|
|
||||||
- name: disable transparent hugepage
|
- name: disable transparent hugepage
|
||||||
command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
|
command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
when: disable_transparent_hugepage
|
when: disable_transparent_hugepage
|
||||||
|
|
||||||
- name: disable swap
|
- name: disable swap
|
||||||
command: swapoff -a
|
command: swapoff -a
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
when: disable_swap
|
when: disable_swap
|
||||||
|
|
||||||
- name: apply operating system tuning
|
- name: apply operating system tuning
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
- name: check if the red hat storage monitor repo is already present
|
- 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
|
shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-mon-rpms
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: rh_storage_mon_repo
|
register: rh_storage_mon_repo
|
||||||
when: mon_group_name in group_names
|
when: mon_group_name in group_names
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
- name: check if the red hat storage osd repo is already present
|
- 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
|
shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-osd-rpms
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: rh_storage_osd_repo
|
register: rh_storage_osd_repo
|
||||||
when: osd_group_name in group_names
|
when: osd_group_name in group_names
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
- name: check if the red hat storage rados gateway repo is already present
|
- 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
|
shell: yum --noplugins --cacheonly repolist | grep -sq rhel-7-server-rhceph-1.3-tools-rpms
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: rh_storage_rgw_repo
|
register: rh_storage_rgw_repo
|
||||||
when: rgw_group_name in group_names
|
when: rgw_group_name in group_names
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
with_items: ceph_config_keys
|
with_items: ceph_config_keys
|
||||||
changed_when: false
|
changed_when: false
|
||||||
sudo: false
|
sudo: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: statconfig
|
register: statconfig
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
- name: try to fetch ceph config and keys
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
with_items: ceph_config_keys
|
with_items: ceph_config_keys
|
||||||
changed_when: false
|
changed_when: false
|
||||||
sudo: false
|
sudo: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: statconfig
|
register: statconfig
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
- name: try to fetch ceph config and keys
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
with_items: ceph_config_keys
|
with_items: ceph_config_keys
|
||||||
changed_when: false
|
changed_when: false
|
||||||
sudo: false
|
sudo: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: statconfig
|
register: statconfig
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
- name: try to fetch ceph config and keys
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
- "{{ openstack_nova_pool }}"
|
- "{{ openstack_nova_pool }}"
|
||||||
- "{{ openstack_cinder_backup_pool }}"
|
- "{{ openstack_cinder_backup_pool }}"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
|
|
||||||
- name: create openstack keys
|
- name: create openstack keys
|
||||||
command: >
|
command: >
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
- ispartition.results
|
- ispartition.results
|
||||||
- devices
|
- devices
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
when:
|
when:
|
||||||
item.0.rc == 0 and
|
item.0.rc == 0 and
|
||||||
item.1.rc != 0
|
item.1.rc != 0
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
- ispartition.results
|
- ispartition.results
|
||||||
- devices
|
- devices
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
when: item.0.rc == 0
|
when: item.0.rc == 0
|
||||||
|
|
||||||
- include: osd_fragment.yml
|
- include: osd_fragment.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"
|
# 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
|
# 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
|
# 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
|
# I believe it's safer
|
||||||
- name: check if the device is a partition or a disk
|
- 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]$))'"
|
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
|
with_items: devices
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: ispartition
|
register: ispartition
|
||||||
|
|
||||||
- name: if partition named 'ceph' exists
|
- name: if partition named 'ceph' exists
|
||||||
shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
|
shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
|
||||||
with_items: devices
|
with_items: devices
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: parted
|
register: parted
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
with_items: ceph_config_keys
|
with_items: ceph_config_keys
|
||||||
changed_when: false
|
changed_when: false
|
||||||
sudo: false
|
sudo: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: statconfig
|
register: statconfig
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
- name: try to fetch ceph config and keys
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
shell: "df | grep {{ item }} | awk '{print $6}'"
|
shell: "df | grep {{ item }} | awk '{print $6}'"
|
||||||
with_items: devices
|
with_items: devices
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: osd_path
|
register: osd_path
|
||||||
|
|
||||||
- name: get osd id
|
- name: get osd id
|
||||||
command: cat {{ item.stdout }}/whoami
|
command: cat {{ item.stdout }}/whoami
|
||||||
with_items: osd_path.results
|
with_items: osd_path.results
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: osd_id
|
register: osd_id
|
||||||
|
|
||||||
- name: create a ceph fragment and assemble directory
|
- name: create a ceph fragment and assemble directory
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
stat: >
|
stat: >
|
||||||
path={{ item }}
|
path={{ item }}
|
||||||
with_items: ceph_config_keys
|
with_items: ceph_config_keys
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: statconfig
|
register: statconfig
|
||||||
|
|
||||||
- name: try to fetch ceph config and keys
|
- name: try to fetch ceph config and keys
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
- name: check if ceph rest api is already started
|
- name: check if ceph rest api is already started
|
||||||
shell: "pgrep ceph-rest-api"
|
shell: "pgrep ceph-rest-api"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
register: restapi_status
|
register: restapi_status
|
||||||
|
|
||||||
- name: start ceph rest api
|
- name: start ceph rest api
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
- a2ensite rgw.conf
|
- a2ensite rgw.conf
|
||||||
- a2dissite *default
|
- a2dissite *default
|
||||||
changed_when: false
|
changed_when: false
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
notify:
|
notify:
|
||||||
- restart apache2
|
- restart apache2
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
- name: check if rgw is started
|
- name: check if rgw is started
|
||||||
command: /etc/init.d/radosgw status
|
command: /etc/init.d/radosgw status
|
||||||
register: rgwstatus
|
register: rgwstatus
|
||||||
ignore_errors: true
|
failed_when: false
|
||||||
|
|
||||||
- name: start rgw
|
- name: start rgw
|
||||||
command: /etc/init.d/radosgw start
|
command: /etc/init.d/radosgw start
|
||||||
|
|
|
@ -92,12 +92,12 @@
|
||||||
- name: Check if sysvinit
|
- name: Check if sysvinit
|
||||||
shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
|
shell: stat /var/lib/ceph/osd/ceph-*/sysvinit
|
||||||
register: osdsysvinit
|
register: osdsysvinit
|
||||||
ignore_errors: True
|
failed_when: false
|
||||||
|
|
||||||
- name: Check if upstart
|
- name: Check if upstart
|
||||||
shell: stat /var/lib/ceph/osd/ceph-*/upstart
|
shell: stat /var/lib/ceph/osd/ceph-*/upstart
|
||||||
register: osdupstart
|
register: osdupstart
|
||||||
ignore_errors: True
|
failed_when: false
|
||||||
|
|
||||||
- name: Gracefully stop the OSDs (Upstart)
|
- name: Gracefully stop the OSDs (Upstart)
|
||||||
service: >
|
service: >
|
||||||
|
|
Loading…
Reference in New Issue