Better --check compatibility for ceph-mon role

Carefully chosen "always_run: true" parameters for read-only tasks that
register variables. This enables --check runs (at least on deployed
clusters).
pull/1121/head
Daniel Marks 2016-11-26 21:05:32 +01:00
parent 7b1dbbbdf8
commit 9337b19ac0
8 changed files with 10 additions and 0 deletions

View File

@ -17,6 +17,7 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
register: statleftover register: statleftover
always_run: true
- name: fail if we find existing cluster files - name: fail if we find existing cluster files
fail: fail:

View File

@ -18,6 +18,7 @@
removes="{{ fetch_directory }}/ceph_cluster_uuid.conf" removes="{{ fetch_directory }}/ceph_cluster_uuid.conf"
changed_when: false changed_when: false
register: cluster_uuid register: cluster_uuid
always_run: true
become: false become: false
when: generate_fsid when: generate_fsid

View File

@ -7,6 +7,7 @@
failed_when: false failed_when: false
run_once: true run_once: true
register: ceph_version register: ceph_version
always_run: true
- set_fact: - set_fact:
after_hamer=True after_hamer=True

View File

@ -17,6 +17,7 @@
become: false become: false
failed_when: false failed_when: false
register: statconfig register: statconfig
always_run: true
- name: try to fetch ceph config and keys - name: try to fetch ceph config and keys
copy: copy:

View File

@ -4,10 +4,12 @@
register: ceph_health register: ceph_health
changed_when: false changed_when: false
failed_when: false failed_when: false
always_run: true
- name: check if it is Atomic host - name: check if it is Atomic host
stat: path=/run/ostree-booted stat: path=/run/ostree-booted
register: stat_ostree register: stat_ostree
always_run: true
- name: set fact for using Atomic host - name: set fact for using Atomic host
set_fact: set_fact:

View File

@ -3,6 +3,7 @@
command: getenforce command: getenforce
register: sestatus register: sestatus
changed_when: false changed_when: false
always_run: true
- name: set selinux permissions - name: set selinux permissions
shell: chcon -Rt svirt_sandbox_file_t {{ item }} shell: chcon -Rt svirt_sandbox_file_t {{ item }}

View File

@ -4,6 +4,7 @@
ceph --connect-timeout 5 --cluster {{ cluster }} df | awk '/rbd/ {print $3}' ceph --connect-timeout 5 --cluster {{ cluster }} df | awk '/rbd/ {print $3}'
changed_when: false changed_when: false
failed_when: false failed_when: false
always_run: true
register: rbd_pool_df register: rbd_pool_df
- name: check pg num for rbd pool - name: check pg num for rbd pool
@ -11,6 +12,7 @@
ceph --connect-timeout 5 --cluster {{ cluster }} osd pool get rbd pg_num | awk '{print $2}' ceph --connect-timeout 5 --cluster {{ cluster }} osd pool get rbd pg_num | awk '{print $2}'
changed_when: false changed_when: false
failed_when: false failed_when: false
always_run: true
register: rbd_pool_pgs register: rbd_pool_pgs
- name: destroy and recreate rbd pool if osd_pool_default_pg_num is not honoured - name: destroy and recreate rbd pool if osd_pool_default_pg_num is not honoured

View File

@ -2,6 +2,7 @@
- name: collect all the pools - name: collect all the pools
command: rados --cluster {{ cluster }} lspools command: rados --cluster {{ cluster }} lspools
register: ceph_pools register: ceph_pools
always_run: true
when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.hammer when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.hammer
- name: secure the cluster - name: secure the cluster