mirror of https://github.com/ceph/ceph-ansible.git
Fix Ansible check mode for site.yml.sample playbook
Make sure the `site.yml.sample` playbook can be run in check mode by skipping
tasks that try to read the output of commands that have been skipped.
Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 54ba38e35e
)
pull/5925/head
parent
7ffc8534ef
commit
69a6053114
|
@ -47,6 +47,7 @@
|
|||
with_items: "{{ list_target_node }}"
|
||||
delegate_to: "{{ item }}"
|
||||
run_once: True
|
||||
when: _crash_keys is not skipped
|
||||
|
||||
- name: start ceph-crash daemon
|
||||
when: containerized_deployment | bool
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
with_items: "{{ _mgr_keys.results }}"
|
||||
when:
|
||||
- cephx | bool
|
||||
- item is not skipped
|
||||
- item.item.copy_key | bool
|
||||
|
||||
- name: set mgr key permissions
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
until:
|
||||
- mgr_dump.rc == 0
|
||||
- (mgr_dump.stdout | from_json).available | bool
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: get enabled modules from ceph-mgr
|
||||
command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} --format json mgr module ls"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
retries: "{{ handler_health_mon_check_retries }}"
|
||||
delay: "{{ handler_health_mon_check_delay }}"
|
||||
changed_when: false
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: fetch ceph initial keys
|
||||
ceph_key:
|
||||
|
|
|
@ -33,4 +33,5 @@
|
|||
with_items: "{{ _osd_keys.results }}"
|
||||
when:
|
||||
- cephx | bool
|
||||
- item is not skipped
|
||||
- item.item.copy_key | bool
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
- (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_osds"] | int > 0
|
||||
- (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_osds"] == (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_up_osds"]
|
||||
when:
|
||||
- not ansible_check_mode
|
||||
- inventory_hostname == ansible_play_hosts_all | last
|
||||
|
||||
- name: include crush_rules.yml
|
||||
|
|
|
@ -30,4 +30,5 @@
|
|||
with_items: "{{ _rgw_keys.results }}"
|
||||
when:
|
||||
- cephx | bool
|
||||
- item is not skipped
|
||||
- item.item.copy_key | bool
|
||||
|
|
|
@ -490,4 +490,6 @@
|
|||
msg: "{{ ceph_status.stdout_lines }}"
|
||||
delegate_to: "{{ groups[mon_group_name][0] }}"
|
||||
run_once: true
|
||||
when: not ceph_status.failed
|
||||
when:
|
||||
- ceph_status is not skipped
|
||||
- ceph_status is successful
|
||||
|
|
Loading…
Reference in New Issue