Explicitly cast boolean variables in cephadm playbook

Depending on the ansible config it might happen that variables are
evaluated as string, resulting in a wrong tasks order execution.
This patch just cast to bool the global variables that drive the
cephadm playbook execution during the overcloud deployment stage.

Change-Id: Iad553cd115c4486b4215d4f8dcf4ffd74d8d1ccb
This commit is contained in:
Francesco Pantano 2022-03-30 17:07:36 +02:00
parent 57ac50c65a
commit 12d6fecb75
No known key found for this signature in database
GPG Key ID: 0458D4D1F41BD75C
7 changed files with 16 additions and 16 deletions

View File

@ -26,22 +26,22 @@
name: tripleo_cephadm
tasks_from: bootstrap
when:
- not tripleo_cephadm_deployed_ceph
- not tripleo_cephadm_deployed_ceph | bool
- name: Apply ceph_conf_overrides on update
import_role:
name: tripleo_cephadm
tasks_from: apply_ceph_conf_overrides
when:
- tripleo_cephadm_apply_ceph_conf_overrides_on_update
- tripleo_cephadm_apply_ceph_conf_overrides_on_update | bool
- name: Apply Ceph spec
import_role:
name: tripleo_cephadm
tasks_from: apply_spec
when:
- not tripleo_cephadm_spec_on_bootstrap
- not tripleo_cephadm_deployed_ceph
- not tripleo_cephadm_spec_on_bootstrap | bool
- not tripleo_cephadm_deployed_ceph | bool
- name: Set crush rules if provided
import_role:

View File

@ -55,8 +55,8 @@
- name: Show results of spec apply
debug:
msg: "{{ tripleo_cephadm_apply_spec_out }}"
when: tripleo_cephadm_verbose
when: tripleo_cephadm_verbose | bool
- name: Wait for the expected number of osds to be running
include_tasks: wait_for_expected_num_osds.yaml
when: tripleo_cephadm_wait_for_osds
when: tripleo_cephadm_wait_for_osds | bool

View File

@ -17,7 +17,7 @@
- name: Add spec to necessary file list when using spec to bootstrap
set_fact:
tripleo_cephadm_bootstrap_files: "{{ tripleo_cephadm_bootstrap_files + [ tripleo_cephadm_spec ] }}"
when: tripleo_cephadm_spec_on_bootstrap
when: tripleo_cephadm_spec_on_bootstrap | bool
- name: Stat necessary files to bootstrap with cephadm
stat:
@ -69,7 +69,7 @@
- name: Show results of bootstrap
debug:
msg: "{{ cephadm_bootstrap }}"
when: tripleo_cephadm_verbose
when: tripleo_cephadm_verbose | bool
when:
- cephadm_ls is defined
- cephadm_ls.stdout == '[]'

View File

@ -19,7 +19,7 @@
{{ tripleo_cephadm_ceph_cli }} config set mgr mgr/cephadm/log_to_cluster_level debug
changed_when: false
become: true
when: tripleo_cephadm_debug
when: tripleo_cephadm_debug | bool
- name: set default container image in ceph configuration
command: |
@ -28,7 +28,7 @@
changed_when: false
become: true
when:
- not (tripleo_cephadm_default_container | default(false))
- not (tripleo_cephadm_default_container | default(false) | bool)
- name: enforce minimum ceph clients version
command: |
@ -47,12 +47,12 @@
changed_when: false
become: true
when:
- not (tripleo_cephadm_default_container | default(false))
- not (tripleo_cephadm_default_container | default(false) | bool)
- name: set dashboard container image in ceph mgr configuration
when:
- tripleo_cephadm_dashboard_enabled | bool
- not (tripleo_cephadm_default_container | default(false))
- not (tripleo_cephadm_default_container | default(false) | bool)
become: true
block:
- name: set alertmanager container image in ceph configuration
@ -83,7 +83,7 @@
when:
- tripleo_cephadm_haproxy_container_image is defined
- tripleo_cephadm_keepalived_container_image is defined
- not (tripleo_cephadm_default_container | default(false))
- not (tripleo_cephadm_default_container | default(false) | bool)
become: true
block:
- name: set haproxy container image in ceph configuration

View File

@ -24,7 +24,7 @@
- name: Check the resulting mgr container instance
debug:
msg: "{{ ceph_mgr.stdout | regex_replace('^ceph-?(.*)-mgr.', '') }}"
when: tripleo_cephadm_verbose
when: tripleo_cephadm_verbose | bool
- name: config the current dashboard backend
command: |

View File

@ -25,7 +25,7 @@
- name: Wait for the expected number of monitors to be running
include_tasks: wait_for_expected_num_mons.yaml
when:
- not tripleo_cephadm_deployed_ceph
- not tripleo_cephadm_deployed_ceph | bool
- tripleo_cephadm_wait_for_mons | bool
- name: Run ceph mon dump to get all monitors

View File

@ -39,7 +39,7 @@
- name: Deployed daemons
debug:
msg: "{{ ceph_orch_ls.stdout_lines }}"
when: tripleo_cephadm_verbose
when: tripleo_cephadm_verbose | bool
- name: Print the status of the deployed Ceph cluster
command: "{{ tripleo_cephadm_ceph_cli }} -s"
become: true