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
54ba38e35ea67c1c342b008be675103e120982d0)
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
state: started
enabled: yes
masked: no
- daemon_reload: yes
\ No newline at end of file
+ daemon_reload: yes
with_items: "{{ _mgr_keys.results }}"
when:
- cephx | bool
+ - item is not skipped
- item.item.copy_key | bool
- name: set mgr key permissions
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"
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:
with_items: "{{ _osd_keys.results }}"
when:
- cephx | bool
+ - item is not skipped
- item.item.copy_key | bool
- (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_osds"] | int > 0
- (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_osds"] == (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_up_osds"]
when:
+ - not ansible_check_mode
- inventory_hostname == ansible_play_hosts_all | last
- name: include crush_rules.yml
with_items: "{{ _rgw_keys.results }}"
when:
- cephx | bool
+ - item is not skipped
- item.item.copy_key | bool
- name: copy SSL certificate & key data to certificate path
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