]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ansible: use 'bool' filter on boolean conditionals
authorL3D <l3d@c3woc.de>
Wed, 22 May 2019 08:02:42 +0000 (10:02 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 6 Jun 2019 08:21:17 +0000 (10:21 +0200)
By running ceph-ansible there are a lot ``[DEPRECATION WARNING]`` like these:
```
[DEPRECATION WARNING]: evaluating containerized_deployment as a bare variable,
this behaviour will go away and you might need to add |bool to the expression
in the future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This
feature will be removed in version 2.12. Deprecation warnings can be disabled
by setting deprecation_warnings=False in ansible.cfg.
```

Now appended ``| bool`` on a lot of the affected variables.

Sometimes the coding style from ``variable|bool`` changed to ``variable | bool`` *(with spaces at the pipe)*.

Closes: #4022
Signed-off-by: L3D <l3d@c3woc.de>
61 files changed:
infrastructure-playbooks/purge-cluster.yml
infrastructure-playbooks/rolling_update.yml
infrastructure-playbooks/shrink-mon.yml
infrastructure-playbooks/shrink-osd.yml
infrastructure-playbooks/untested-by-ci/recover-osds-after-ssd-journal-failure.yml
infrastructure-playbooks/untested-by-ci/replace-osd.yml
library/ceph_crush.py
roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-client/tasks/main.yml
roles/ceph-client/tasks/pre_requisite.yml
roles/ceph-common/tasks/create_rbd_client_dir.yml
roles/ceph-common/tasks/installs/configure_redhat_local_installation.yml
roles/ceph-config/tasks/main.yml
roles/ceph-container-common/tasks/fetch_image.yml
roles/ceph-container-engine/tasks/pre_requisites/prerequisites.yml
roles/ceph-dashboard/tasks/configure_dashboard.yml
roles/ceph-facts/tasks/facts.yml
roles/ceph-grafana/tasks/configure_grafana.yml
roles/ceph-handler/handlers/main.yml
roles/ceph-handler/tasks/check_running_cluster.yml
roles/ceph-infra/tasks/configure_firewall.yml
roles/ceph-infra/tasks/main.yml
roles/ceph-infra/tasks/setup_ntp.yml
roles/ceph-iscsi-gw/tasks/common.yml
roles/ceph-iscsi-gw/tasks/main.yml
roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml
roles/ceph-mds/tasks/main.yml
roles/ceph-mgr/tasks/common.yml
roles/ceph-mgr/tasks/main.yml
roles/ceph-mgr/tasks/start_mgr.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-mon/tasks/crush_rules.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/tasks/main.yml
roles/ceph-mon/tasks/start_monitor.yml
roles/ceph-nfs/tasks/common.yml
roles/ceph-nfs/tasks/create_rgw_nfs_user.yml
roles/ceph-nfs/tasks/main.yml
roles/ceph-nfs/tasks/pre_requisite_container.yml
roles/ceph-nfs/tasks/pre_requisite_non_container.yml
roles/ceph-nfs/tasks/pre_requisite_non_container_debian.yml
roles/ceph-nfs/tasks/start_nfs.yml
roles/ceph-osd/tasks/common.yml
roles/ceph-osd/tasks/container_options_facts.yml
roles/ceph-osd/tasks/main.yml
roles/ceph-osd/tasks/openstack_config.yml
roles/ceph-osd/tasks/start_osds.yml
roles/ceph-osd/tasks/system_tuning.yml
roles/ceph-rbd-mirror/tasks/common.yml
roles/ceph-rbd-mirror/tasks/main.yml
roles/ceph-rgw/tasks/common.yml
roles/ceph-rgw/tasks/main.yml
roles/ceph-rgw/tasks/multisite/main.yml
roles/ceph-rgw/tasks/pre_requisite.yml
roles/ceph-validate/tasks/main.yml
site-container.yml.sample
site.yml.sample
tests/functional/lvm_setup.yml
tests/functional/rgw_multisite.yml
tests/functional/rhcs_setup.yml
tests/functional/setup.yml

index eb982e0182919f22a740f84d597b89f71bc14f62..a3b15e16cd5e0f70ba90429b1dfe3dfc9419eedd 100644 (file)
       - wait for server to boot
       - remove data
     when:
-      - reboot_osd_node
+      - reboot_osd_node | bool
       - remove_osd_mountpoints.failed is defined
 
   - name: wipe table on dm-crypt devices
       state: absent
     when:
       - ansible_pkg_mgr == 'yum'
-      - purge_all_packages == true
+      - purge_all_packages | bool
 
   - name: purge remaining ceph packages with dnf
     dnf:
       state: absent
     when:
       - ansible_pkg_mgr == 'dnf'
-      - purge_all_packages == true
+      - purge_all_packages | bool
 
   - name: purge remaining ceph packages with apt
     apt:
       state: absent
     when:
       - ansible_pkg_mgr == 'apt'
-      - purge_all_packages == true
+      - purge_all_packages | bool
 
   - name: remove config
     file:
index 69e23e8ccb3658e325ca3500fae86077e183a0a6..1db76da1175f71e06610c74229c6707495b6f52a 100644 (file)
@@ -84,7 +84,7 @@
       file:
         path: /etc/profile.d/ceph-aliases.sh
         state: absent
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: set mon_host_count
       set_fact:
       delegate_to: "{{ item }}"
       with_items: "{{ groups[mon_group_name] }}"
       when:
-        - cephx
+        - cephx | bool
         - inventory_hostname == groups[mon_group_name][0]
 
     - name: create potentially missing keys (rbd and rbd-mirror)
         CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       when:
-        - cephx
+        - cephx | bool
         - inventory_hostname == groups[mon_group_name][0]
 
     # NOTE: we mask the service so the RPM can't restart it
         enabled: no
         masked: yes
       ignore_errors: True
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     # NOTE: we mask the service so the RPM can't restart it
     # after the package gets upgraded
         enabled: no
         masked: yes
       ignore_errors: True
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     # only mask the service for mgr because it must be upgraded
     # after ALL monitors, even when collocated
       delegate_to: "{{ mon_host }}"
       when:
         - inventory_hostname == groups[mon_group_name][0]
-        - not containerized_deployment
+        - not containerized_deployment | bool
 
     - name: set containerized osd flags
       command: >
       delegate_to: "{{ mon_host }}"
       when:
         - inventory_hostname == groups[mon_group_name][0]
-        - containerized_deployment
+        - containerized_deployment | bool
 
     - import_role:
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
         name: ceph-mon@{{ monitor_name }}
         state: started
         enabled: yes
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: start ceph mgr
       systemd:
         state: started
         enabled: yes
       ignore_errors: True # if no mgr collocated with mons
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: restart containerized ceph mon
       systemd:
         state: restarted
         enabled: yes
         daemon_reload: yes
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: non container | waiting for the monitor to join the quorum...
       command: ceph --cluster "{{ cluster }}" -m "{{ hostvars[groups[mon_group_name][0]]['_current_monitor_address'] }}" -s --format json
           hostvars[inventory_hostname]['ansible_fqdn'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"])
       retries: "{{ health_mon_check_retries }}"
       delay: "{{ health_mon_check_delay }}"
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: container | waiting for the containerized monitor to join the quorum...
       command: >
           hostvars[inventory_hostname]['ansible_fqdn'] in (ceph_health_raw.stdout | default('{}') | from_json)["quorum_names"])
       retries: "{{ health_mon_check_retries }}"
       delay: "{{ health_mon_check_delay }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
 - name: upgrade ceph mgr nodes when implicitly collocated on monitors
   vars:
             name: ceph-handler
         - import_role:
             name: ceph-common
-          when: not containerized_deployment
+          when: not containerized_deployment | bool
         - import_role:
             name: ceph-container-common
-          when: containerized_deployment
+          when: containerized_deployment | bool
         - import_role:
             name: ceph-config
         - import_role:
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
       shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi"
       register: osd_ids
       changed_when: false
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: get osd unit names - container
       shell: systemctl list-units | grep -E "loaded * active" | grep -oE "ceph-osd@([a-z0-9]+).service"
       register: osd_names
       changed_when: false
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: set num_osds for container
       set_fact:
         num_osds: "{{ osd_names.stdout_lines|default([])|length }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment | bool
 
     - name: stop ceph osd
       systemd:
         enabled: no
         masked: yes
       with_items: "{{ osd_ids.stdout_lines }}"
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: set num_osds for non container
       set_fact:
         num_osds: "{{ osd_ids.stdout_lines|default([])|length }}"
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment | bool
 
     - import_role:
         name: ceph-defaults
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
       shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi"
       register: osd_ids
       changed_when: false
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: start ceph osd
       systemd:
         enabled: yes
         masked: no
       with_items: "{{ osd_ids.stdout_lines }}"
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: restart containerized ceph osd
       systemd:
         masked: no
         daemon_reload: yes
       with_items: "{{ osd_names.stdout_lines }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: scan ceph-disk osds with ceph-volume if deploying nautilus
       command: "ceph-volume --cluster={{ cluster }} simple scan"
         CEPH_VOLUME_DEBUG: 1
       when:
         - ceph_release in ["nautilus", "octopus"]
-        - not containerized_deployment
+        - not containerized_deployment | bool
 
     - name: activate scanned ceph-disk osds and migrate to ceph-volume if deploying nautilus
       command: "ceph-volume --cluster={{ cluster }} simple activate --all"
         CEPH_VOLUME_DEBUG: 1
       when:
         - ceph_release in ["nautilus", "octopus"]
-        - not containerized_deployment
+        - not containerized_deployment | bool
 
     - name: set_fact container_exec_cmd_osd
       set_fact:
         container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: get osd versions
       command: "{{ container_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"
     - name: set_fact container_exec_cmd_osd
       set_fact:
         container_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: unset osd flags
       command: "{{ container_exec_cmd_update_osd|default('') }} ceph osd unset {{ item }} --cluster {{ cluster }}"
         state: stopped
         enabled: no
         masked: yes
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - import_role:
         name: ceph-defaults
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
         state: started
         enabled: yes
         masked: no
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: restart ceph mds
       systemd:
         enabled: yes
         masked: no
         daemon_reload: yes
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
 
 - name: upgrade ceph rgws cluster
         enabled: no
         masked: yes
       with_items: "{{ rgw_instances }}"
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - import_role:
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
         masked: no
         daemon_reload: yes
       with_items: "{{ rgw_instances }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
 
 - name: upgrade ceph rbd mirror node
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
         state: started
         enabled: yes
         masked: no
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: restart containerized ceph rbd mirror
       systemd:
         enabled: yes
         masked: no
         daemon_reload: yes
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
 
 - name: upgrade ceph nfs node
         enabled: no
         masked: yes
       failed_when: false
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - import_role:
         name: ceph-defaults
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
         enabled: yes
         masked: no
       when:
-        - not containerized_deployment
-        - ceph_nfs_enable_service
+        - not containerized_deployment | bool
+        - ceph_nfs_enable_service | bool
 
     - name: systemd restart nfs container
       systemd:
         masked: no
         daemon_reload: yes
       when:
-        - ceph_nfs_enable_service
-        - containerized_deployment
+        - ceph_nfs_enable_service | bool
+        - containerized_deployment | bool
 
 
 - name: upgrade ceph iscsi gateway node
         - rbd-target-api
         - rbd-target-gw
         - tcmu-runner
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - import_role:
         name: ceph-defaults
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
         - tcmu-runner
         - rbd-target-api
         - rbd-target-gw
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
 
 - name: upgrade ceph client node
         name: ceph-handler
     - import_role:
         name: ceph-common
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
     - import_role:
         name: ceph-container-common
-      when: containerized_deployment
+      when: containerized_deployment | bool
     - import_role:
         name: ceph-config
     - import_role:
       command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph osd require-osd-release nautilus"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: non container | disallow pre-nautilus OSDs and enable all new nautilus-only functionality
       command: "ceph --cluster {{ cluster }} osd require-osd-release nautilus"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: container | enable msgr2 protocol
       command: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph mon enable-msgr2"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: non container | enable msgr2 protocol
       command: "ceph --cluster {{ cluster }} mon enable-msgr2"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: True
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - import_role:
         name: ceph-handler
     - name: set_fact container_exec_cmd_status
       set_fact:
         container_exec_cmd_status: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: show ceph status
       command: "{{ container_exec_cmd_status|default('') }} ceph --cluster {{ cluster }} -s"
index 712097c834f3a5c05580e3d23239a40303ec36b4..d8a66436c878e6feaab5c657d0e4a8e79aa1a3d5 100644 (file)
@@ -77,7 +77,7 @@
     - name: "set_fact container_exec_cmd build {{ container_binary }} exec command (containerized)"
       set_fact:
         container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: exit playbook, if can not connect to the cluster
       command: "{{ container_exec_cmd }} timeout 5 ceph --cluster {{ cluster }} health"
index 6ef4281b071144abb3e270a70377a4646e25cadf..6ee3c2c634be36155d5d5fe71f789090db2de93a 100644 (file)
@@ -65,7 +65,7 @@
     - name: set_fact container_exec_cmd build docker exec command (containerized)
       set_fact:
         container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: exit playbook, if can not connect to the cluster
       command: "{{ container_exec_cmd }} timeout 5 ceph --cluster {{ cluster }} health"
index f1f4796c34fa4eb21073a1c034f94a7818b80916..592556b0574670c0fd1242b659c867b63557ccd0 100644 (file)
@@ -73,7 +73,7 @@
     with_items:
         osds_dir_stat.results
     when:
-      - osds_dir_stat is defined 
+      - osds_dir_stat is defined | bool
       - item.stat.exists == false
 
   - name: install sgdisk(gdisk)
index 204202b00586f8f3edaaf162038f52c077e368ce..9184598f94c4bc11eaac95076e24296f9ebdfde0 100644 (file)
@@ -61,7 +61,7 @@
     - name: set_fact container_exec_cmd build docker exec command (containerized)
       set_fact:
         container_exec_cmd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: exit playbook, if can not connect to the cluster
       command: "{{ container_exec_cmd | default('') }} timeout 5 ceph --cluster {{ cluster }} health"
       with_items: "{{ osd_hosts }}"
       delegate_to: "{{ item }}"
       failed_when: false
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: fail when admin key is not present
       fail:
         msg: "The Ceph admin key is not present on the OSD node, please add it and remove it after the playbook is done."
       with_items: "{{ ceph_admin_key.results }}"
       when:
-        - not containerized_deployment
+        - not containerized_deployment | bool
         - item.stat.exists == false
 
     # NOTE(leseb): using '>' is the only way I could have the command working
         - "{{ osd_to_replace.split(',') }}"
       register: osd_to_replace_disks
       delegate_to: "{{ item.0 }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: zapping osd(s) - container
       shell: >
         - "{{ osd_hosts }}"
         - "{{ osd_to_replace_disks.results }}"
       delegate_to: "{{ item.0 }}"
-      when: containerized_deployment
+      when: containerized_deployment | bool
 
     - name: zapping osd(s) - non container
       command: ceph-disk zap --cluster {{ cluster }} {{ item.1 }}
         - "{{ osd_hosts }}"
         - "{{ osd_to_replace_disks.results }}"
       delegate_to: "{{ item.0 }}"
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: destroying osd(s)
       command: ceph-disk destroy --cluster {{ cluster }} --destroy-by-id {{ item.1 }} --zap
         - "{{ osd_hosts }}"
         - "{{ osd_to_replace.split(',') }}"
       delegate_to: "{{ item.0 }}"
-      when: not containerized_deployment
+      when: not containerized_deployment | bool
 
     - name: replace osd(s) - prepare - non container
       command: ceph-disk prepare {{ item.1 }}  --osd-id {{ item.2 }} --osd-uuid $(uuidgen)
index 4086cd7571234385045b6ded94cace65ef016e7b..f9e90d685644565ae1fbdb3c4a06facd2f2b7bea 100644 (file)
@@ -56,7 +56,7 @@ EXAMPLES = '''
     location: "{{ hostvars[item]['osd_crush_location'] }}"
     containerized: "{{ container_exec_cmd }}"
   with_items: "{{ groups[osd_group_name] }}"
-  when: crush_rule_config
+  when: crush_rule_config | bool
 '''
 
 RETURN = '''#  '''
index c8ddff3bf7e866fdd3e4ed1bec95a2140bf853c9..41b261ddadda4fa6336a25e8bb61add0521fb346 100644 (file)
@@ -20,7 +20,7 @@
     name: "{{ item }}"
     groups: _filtered_clients
   with_items: "{{ groups[client_group_name] }}"
-  when: (hostvars[item]['ansible_architecture'] == 'x86_64') or (not containerized_deployment)
+  when: (hostvars[item]['ansible_architecture'] == 'x86_64') or (not containerized_deployment | bool)
 
 - name: set_fact delegated_node
   set_fact:
@@ -50,7 +50,7 @@
     - "{{ ceph_nfs_ceph_user | default([]) }}"
   delegate_to: "{{ delegated_node }}"
   when:
-    - cephx
+    - cephx | bool
     - keys | length > 0
     - inventory_hostname == groups.get('_filtered_clients') | first
 
   register: slurp_client_keys
   delegate_to: "{{ delegated_node }}"
   when:
-    - cephx
+    - cephx | bool
     - keys | length > 0
     - inventory_hostname == groups.get('_filtered_clients') | first
 
 - name: pool related tasks
   when:
-    - condition_copy_admin_key
+    - condition_copy_admin_key | bool
     - inventory_hostname == groups.get('_filtered_clients', []) | first
   block:
     - name: list existing pool(s)
index 86794bc4a37b1caaf25b5ffeeeeb4859cb58f1a7..18cab7ea6e857a235b398e8e43034ecd41fb9819 100644 (file)
@@ -4,4 +4,4 @@
 
 - name: include create_users_keys.yml
   include_tasks: create_users_keys.yml
-  when: user_config
+  when: user_config | bool
index 2db91cf2109b7bddfa50188fac9d0b48ef1a5bb8..582fb2f60eb2f3802af79ee930ec7108e68af0b4 100644 (file)
@@ -7,5 +7,5 @@
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   when:
-    - cephx
-    - copy_admin_key
+    - cephx | bool
+    - copy_admin_key | bool
index f893bbcfc5049e0ac6eb452a46d55be6e397016e..5560acdcba4b319eccd0ffaeb551b127fea483f9 100644 (file)
@@ -9,4 +9,4 @@
   with_items:
     - "{{ rbd_client_admin_socket_path }}"
     - "{{ rbd_client_log_path }}"
-  when: rbd_client_directories
+  when: rbd_client_directories | bool
index 6f18a11ba8f65bafe9147af496abc119cb3ba7b1..27a26ffd3bece2ee348793e653ecec4eed3c900d 100644 (file)
@@ -3,25 +3,25 @@
   file:
     path: /tmp
     state: directory
-  when: use_installer
+  when: use_installer | bool
 
 - name: use mktemp to create name for rundep
   command: "mktemp /tmp/rundep.XXXXXXXX"
   register: rundep_location
-  when: use_installer
+  when: use_installer | bool
 
 - name: copy rundep
   copy:
     src: "{{ ansible_dir }}/rundep"
     dest: "{{ item }}"
   with_items: "{{ (rundep_location|default({})).stdout_lines|default([]) }}"
-  when: use_installer
+  when: use_installer | bool
 
 - name: install ceph dependencies
   script: "{{ ansible_dir }}/rundep_installer.sh {{ item }}"
   become: true
   with_items: "{{ (rundep_location|default({})).stdout_lines|default([]) }}"
-  when: use_installer
+  when: use_installer | bool
 
 - name: ensure rsync is installed
   package:
index 29f6071ad05e5abe76b4d1d95bc2cd917c030bfa..692b60eef116c388f57e68345578e313704d9506 100644 (file)
@@ -1,14 +1,14 @@
 ---
 - name: include create_ceph_initial_dirs.yml
   include_tasks: create_ceph_initial_dirs.yml
-  when: containerized_deployment|bool
+  when: containerized_deployment | bool
 
 - name: config file operations related to OSDs
   when:
     - inventory_hostname in groups.get(osd_group_name, [])
     # the rolling_update.yml playbook sets num_osds to the number of currently
     # running osds
-    - not rolling_update
+    - not rolling_update | bool
   block:
   - name: count number of osds for lvm scenario
     set_fact:
@@ -62,7 +62,7 @@
 
 # ceph-common
 - name: config file operation for non-containerized scenarios
-  when: not containerized_deployment|bool
+  when: not containerized_deployment | bool
   block:
   - name: create ceph conf directory
     file:
@@ -98,7 +98,7 @@
       state: directory
       mode: "0755"
     delegate_to: localhost
-    when: ceph_conf_local
+    when: ceph_conf_local | bool
 
   - name: "generate {{ cluster }}.conf configuration file locally"
     config_template:
       config_type: ini
     when:
       - inventory_hostname in groups[mon_group_name]
-      - ceph_conf_local
+      - ceph_conf_local | bool
 
 - name: config file operations for containerized scenarios
-  when: containerized_deployment|bool
+  when: containerized_deployment | bool
   block:
   - name: create a local fetch directory if it does not exist
     file:
     become: false
     run_once: true
     when:
-      - (cephx or generate_fsid)
+      - (cephx or generate_fsid) | bool
       - ((inventory_hostname in groups.get(mon_group_name, [])) or
         (groups.get(nfs_group_name, []) | length > 0) and inventory_hostname == groups.get(nfs_group_name, [])[0])
 
index f894111b3c05ce7e09fec60a68d2cdd1e0e4be29..a3e41bb1fcfffb37bd1f97bc8ca5c057f70a4e38 100644 (file)
   until: docker_image.rc == 0
   retries: "{{ docker_pull_retry }}"
   delay: 10
-  when: (ceph_docker_dev_image is undefined or not ceph_docker_dev_image)
+  when: (ceph_docker_dev_image is undefined or not ceph_docker_dev_image | bool)
 
 - name: "inspecting {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} image after pulling"
   command: "{{ container_binary }} inspect {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
   copy:
     src: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
     dest: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
-  when: (ceph_docker_dev_image is defined and ceph_docker_dev_image)
+  when: (ceph_docker_dev_image is defined and ceph_docker_dev_image | bool)
 
 - name: load ceph dev image
   command: "{{ container_binary }} load -i /tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
-  when: (ceph_docker_dev_image is defined and ceph_docker_dev_image)
+  when: (ceph_docker_dev_image is defined and ceph_docker_dev_image | bool)
 
 - name: remove tmp ceph dev image file
   file:
     name: "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
     state: absent
-  when: (ceph_docker_dev_image is defined and ceph_docker_dev_image)
+  when: (ceph_docker_dev_image is defined and ceph_docker_dev_image | bool)
 
index c048f356ef176b854c05b65db1d1115ec34e0707..76705758b4b26bb4abf6b2f709956329f2aa24e6 100644 (file)
@@ -19,7 +19,7 @@
     enabled: yes
   when:
     - ansible_distribution == 'CentOS'
-    - ceph_docker_enable_centos_extra_repo
+    - ceph_docker_enable_centos_extra_repo | bool
   tags:
     with_pkg
 
index 1de6c25799243ae172d695d72a67658de8e7e8ae..43917654c53b6417a52cbd6495ee20060c0d6cb9 100644 (file)
@@ -2,7 +2,7 @@
 - name: set_fact container_exec_cmd
   set_fact:
     container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: disable SSL for dashboard
   command: "{{ container_exec_cmd }} ceph config set mgr mgr/dashboard/ssl false"
@@ -22,7 +22,7 @@
     group: root
     mode: 0440
   when:
-    - dashboard_crt
+    - dashboard_crt | bool
     - dashboard_protocol == "https"
 
 - name: copy dashboard SSL certificate key
@@ -33,7 +33,7 @@
     group: root
     mode: 0440
   when:
-    - dashboard_key
+    - dashboard_key | bool
     - dashboard_protocol == "https"
 
 - name: generate a Self Signed OpenSSL certificate for dashboard
@@ -42,7 +42,7 @@
     openssl req -new -nodes -x509 -subj '/O=IT/CN=ceph-dashboard' -days 3650 -keyout /etc/ceph/ceph-dashboard.key -out /etc/ceph/ceph-dashboard.crt -extensions v3_ca
   when:
     - dashboard_protocol == "https"
-    - not dashboard_key or not dashboard_crt
+    - not dashboard_key | bool or not dashboard_crt | bool
 
 - name: import dashboard certificate file
   command: "{{ container_exec_cmd }} ceph config-key set mgr/dashboard/crt -i /etc/ceph/ceph-dashboard.crt"
   command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-host {{ dashboard_rgw_api_host }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when: dashboard_rgw_api_host
+  when: dashboard_rgw_api_host | bool
 
 - name: set the rgw port
   command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-port {{ dashboard_rgw_api_port }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when: dashboard_rgw_api_port
+  when: dashboard_rgw_api_port | bool
 
 - name: set the rgw scheme
   command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-scheme {{ dashboard_rgw_api_scheme }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when: dashboard_rgw_api_scheme
+  when: dashboard_rgw_api_scheme | bool
 
 - name: set the rgw admin resource
   command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-admin-resource {{ dashboard_rgw_api_admin_resource }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when: dashboard_rgw_api_admin_resource
+  when: dashboard_rgw_api_admin_resource | bool
 
 - name: disable ssl verification for rgw
   command: "{{ container_exec_cmd }} ceph dashboard set-rgw-api-ssl-verify False"
index 9ef94eb8f50f6aaa93770eea7cabcf9062a07eb7..9df92ece8001c87528ba313ba90241e089033444 100644 (file)
 - name: set_fact monitor_name ansible_hostname
   set_fact:
     monitor_name: "{{ ansible_hostname }}"
-  when: not mon_use_fqdn
+  when: not mon_use_fqdn | bool
 
 - name: set_fact monitor_name ansible_fqdn
   set_fact:
     monitor_name: "{{ ansible_fqdn }}"
-  when: mon_use_fqdn
+  when: mon_use_fqdn | bool
 
 - name: set_fact container_exec_cmd
   set_fact:
     container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] if not rolling_update else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}"
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - groups.get(mon_group_name, []) | length > 0
 
 # this task shouldn't run in a rolling_update situation
@@ -55,7 +55,7 @@
   run_once: true
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when:
-    - not rolling_update
+    - not rolling_update | bool
     - groups.get(mon_group_name, []) | length > 0
 
 # set this as a default when performing a rolling_update
   delegate_to: localhost
   changed_when: false
   become: false
-  when: cephx or generate_fsid
+  when: cephx | bool or generate_fsid | bool
 
 - name: get current fsid
   command: "{{ timeout_command }} {{ container_exec_cmd }} ceph --cluster {{ cluster }} daemon mon.{{ hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }} config get fsid"
   register: rolling_update_fsid
   delegate_to: "{{ mon_host | default(groups[mon_group_name][0]) }}"
-  when: rolling_update
+  when: rolling_update | bool
 
 - name: set_fact fsid
   set_fact:
     fsid: "{{ (rolling_update_fsid.stdout | from_json).fsid }}"
-  when: rolling_update
+  when: rolling_update | bool
 
 - name: set_fact ceph_current_status (convert to json)
   set_fact:
     ceph_current_status: "{{ ceph_current_status.stdout | from_json }}"
   when:
-    - not rolling_update
+    - not rolling_update | bool
     - ceph_current_status.rc == 0
 
 - name: set_fact fsid from ceph_current_status
 
 - name: fsid realted tasks
   when:
-    - generate_fsid
+    - generate_fsid | bool
     - ceph_current_status.fsid is undefined
-    - not rolling_update
+    - not rolling_update | bool
   block:
   - name: generate cluster fsid
     shell: python -c 'import uuid; print(str(uuid.uuid4()))'
 - name: set_fact mds_name ansible_hostname
   set_fact:
     mds_name: "{{ ansible_hostname }}"
-  when: not mds_use_fqdn
+  when: not mds_use_fqdn | bool
 
 - name: set_fact mds_name ansible_fqdn
   set_fact:
     mds_name: "{{ ansible_fqdn }}"
-  when: mds_use_fqdn
+  when: mds_use_fqdn | bool
 
 - name: set_fact rbd_client_directory_owner ceph
   set_fact:
   when:
     - devices is defined
     - inventory_hostname in groups.get(osd_group_name, [])
-    - not osd_auto_discovery|default(False)
+    - not osd_auto_discovery | default(False) | bool
 
 - name: set_fact build devices from resolved symlinks
   set_fact:
   when:
     - devices is defined
     - inventory_hostname in groups.get(osd_group_name, [])
-    - not osd_auto_discovery|default(False)
+    - not osd_auto_discovery | default(False) | bool
 
 - name: set_fact build final devices list
   set_fact:
   when:
     - devices is defined
     - inventory_hostname in groups.get(osd_group_name, [])
-    - not osd_auto_discovery|default(False)
+    - not osd_auto_discovery | default(False) | bool
 
 - name: set_fact devices generate device list when osd_auto_discovery
   set_fact:
     devices: "{{ devices | default([]) + [ item.key | regex_replace('^', '/dev/') ] }}"
   with_dict: "{{ ansible_devices }}"
   when:
-    - osd_auto_discovery|default(False)
+    - osd_auto_discovery | default(False) | bool
     - ansible_devices is defined
     - item.value.removable == "0"
     - item.value.sectors != "0"
   set_fact:
     ceph_uid: 64045
   when:
-    - not containerized_deployment
+    - not containerized_deployment | bool
     - ansible_os_family == 'Debian'
 
 - name: set_fact ceph_uid for red hat or suse based system - non container
   set_fact:
     ceph_uid: 167
   when:
-    - not containerized_deployment
+    - not containerized_deployment | bool
     - ansible_os_family in ['RedHat', 'Suse']
 
 - name: set_fact ceph_uid for debian based system - container
   set_fact:
     ceph_uid: 64045
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - ceph_docker_image_tag | string is search("ubuntu")
 
 - name: set_fact ceph_uid for red hat based system - container
   set_fact:
     ceph_uid: 167
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - (ceph_docker_image_tag | string is search("latest") or ceph_docker_image_tag | string is search("centos") or ceph_docker_image_tag | string is search("fedora")
       or (ansible_distribution == 'RedHat'))
 
   set_fact:
     ceph_uid: 167
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - ceph_docker_image is search("rhceph")
 
 - name: set_fact rgw_hostname
index d6d63b04a32014df0ea56c65c446cd909ecbf101..7aa444ab71d00700472a661202866a20e77c6137 100644 (file)
@@ -52,7 +52,7 @@
     dest: "/etc/grafana/ceph-dashboard.crt"
     mode: 0640
   when:
-    - grafana_crt
+    - grafana_crt | bool
     - dashboard_protocol == "https"
 
 - name: copy grafana SSL certificate key
@@ -61,7 +61,7 @@
     dest: "/etc/grafana/ceph-dashboard.key"
     mode: 0440
   when:
-    - grafana_key
+    - grafana_key | bool
     - dashboard_protocol == "https"
 
 - name: generate a Self Signed OpenSSL certificate for dashboard
@@ -70,7 +70,7 @@
     openssl req -new -nodes -x509 -subj '/O=IT/CN=ceph-grafana' -days 3650 -keyout /etc/grafana/ceph-dashboard.key -out /etc/grafana/ceph-dashboard.crt -extensions v3_ca
   when:
     - dashboard_protocol == "https"
-    - not grafana_key or not grafana_crt
+    - not grafana_key | bool or not grafana_crt | bool
 
 - name: set owner/group on /etc/grafana
   file:
index 9333b9cc2daa859d3c9b6b92491c58f72ebaf8e6..cb637d94acac23c21bfc15dcb2f44a939538cc69 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: handlers
-  when: not rolling_update
+  when: not rolling_update | bool
   block:
     - name: update apt cache
       apt:
@@ -27,7 +27,7 @@
       listen: "restart ceph mons"
       when:
         - mon_group_name in group_names
-        - not rolling_update
+        - not rolling_update | bool
 
     - name: restart ceph mon daemon(s) - non container
       command: /usr/bin/env bash /tmp/restart_mon_daemon.sh
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - mon_group_name in group_names
-        - not containerized_deployment
-        - hostvars[item]['_mon_handler_called'] | default(False)
+        - not containerized_deployment | bool
+        - hostvars[item]['_mon_handler_called'] | default(False) | bool
         - mon_socket_stat.rc == 0
-        - not rolling_update
+        - not rolling_update | bool
       with_items: "{{ groups[mon_group_name] }}"
       delegate_to: "{{ item }}"
       run_once: True
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - mon_group_name in group_names
-        - containerized_deployment
+        - containerized_deployment | bool
         - ceph_mon_container_stat.get('rc') == 0
-        - hostvars[item]['_mon_handler_called'] | default(False)
+        - hostvars[item]['_mon_handler_called'] | default(False) | bool
         - ceph_mon_container_stat.get('stdout_lines', [])|length != 0
-        - not rolling_update
+        - not rolling_update | bool
       with_items: "{{ groups[mon_group_name] }}"
       delegate_to: "{{ item }}"
       run_once: True
       listen: "restart ceph osds"
       when:
         - osd_group_name in group_names
-        - not rolling_update
+        - not rolling_update | bool
 
     - name: restart ceph osds daemon(s) - non container
       command: /usr/bin/env bash /tmp/restart_osd_daemon.sh
       listen: "restart ceph osds"
       when:
         - osd_group_name in group_names
-        - not containerized_deployment
-        - not rolling_update
+        - not containerized_deployment | bool
+        - not rolling_update | bool
         # We do not want to run these checks on initial deployment (`socket_osd_container.results[n].rc == 0`)
         # except when a crush location is specified. ceph-disk will start the osds before the osd crush location is specified
         - osd_socket_stat.rc == 0
         - ceph_current_status.fsid is defined
-        - handler_health_osd_check
-        - hostvars[item]['_osd_handler_called'] | default(False)
+        - handler_health_osd_check | bool
+        - hostvars[item]['_osd_handler_called'] | default(False) | bool
       with_items: "{{ groups[osd_group_name] }}"
       delegate_to: "{{ item }}"
       run_once: True
         # We do not want to run these checks on initial deployment (`socket_osd_container_stat.results[n].rc == 0`)
         # except when a crush location is specified. ceph-disk will start the osds before the osd crush location is specified
         - osd_group_name in group_names
-        - containerized_deployment
-        - not rolling_update
+        - containerized_deployment | bool
+        - not rolling_update | bool
         - inventory_hostname == groups.get(osd_group_name) | last
         - ceph_osd_container_stat.get('rc') == 0
         - ceph_osd_container_stat.get('stdout_lines', [])|length != 0
-        - handler_health_osd_check
+        - handler_health_osd_check | bool
         - hostvars[item]['_osd_handler_called'] | default(False)
       with_items: "{{ groups[osd_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - mds_group_name in group_names
-        - not containerized_deployment
-        - hostvars[item]['_mds_handler_called'] | default(False)
+        - not containerized_deployment | bool
+        - hostvars[item]['_mds_handler_called'] | default(False) | bool
         - mds_socket_stat.rc == 0
       with_items: "{{ groups[mds_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - mds_group_name in group_names
-        - containerized_deployment
+        - containerized_deployment | bool
         - ceph_mds_container_stat.get('rc') == 0
-        - hostvars[item]['_mds_handler_called'] | default(False)
+        - hostvars[item]['_mds_handler_called'] | default(False) | bool
         - ceph_mds_container_stat.get('stdout_lines', [])|length != 0
       with_items: "{{ groups[mds_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - rgw_group_name in group_names
-        - not containerized_deployment
-        - hostvars[item]['_rgw_handler_called'] | default(False)
+        - not containerized_deployment | bool
+        - hostvars[item]['_rgw_handler_called'] | default(False) | bool
         - rgw_socket_stat.rc == 0
       with_items: "{{ groups[rgw_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - rgw_group_name in group_names
-        - containerized_deployment
+        - containerized_deployment | bool
         - ceph_rgw_container_stat.get('rc') == 0
-        - hostvars[item]['_rgw_handler_called'] | default(False)
+        - hostvars[item]['_rgw_handler_called'] | default(False) | bool
         - ceph_rgw_container_stat.get('stdout_lines', [])|length != 0
       with_items: "{{ groups[rgw_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - nfs_group_name in group_names
-        - not containerized_deployment
-        - hostvars[item]['_nfs_handler_called'] | default(False)
+        - not containerized_deployment | bool
+        - hostvars[item]['_nfs_handler_called'] | default(False) | bool
         - nfs_socket_stat.rc == 0
       with_items: "{{ groups[nfs_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - nfs_group_name in group_names
-        - containerized_deployment
+        - containerized_deployment | bool
         - ceph_nfs_container_stat.get('rc') == 0
-        - hostvars[item]['_nfs_handler_called'] | default(False)
+        - hostvars[item]['_nfs_handler_called'] | default(False) | bool
         - ceph_nfs_container_stat.get('stdout_lines', [])|length != 0
       with_items: "{{ groups[nfs_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - rbdmirror_group_name in group_names
-        - not containerized_deployment
-        - hostvars[item]['_rbdmirror_handler_called'] | default(False)
+        - not containerized_deployment | bool
+        - hostvars[item]['_rbdmirror_handler_called'] | default(False) | bool
         - rbd_mirror_socket_stat.rc == 0
       with_items: "{{ groups[rbdmirror_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - rbdmirror_group_name in group_names
-        - containerized_deployment
+        - containerized_deployment | bool
         - ceph_rbd_mirror_container_stat.get('rc') == 0
-        - hostvars[item]['_rbdmirror_handler_called'] | default(False)
+        - hostvars[item]['_rbdmirror_handler_called'] | default(False) | bool
         - ceph_rbd_mirror_container_stat.get('stdout_lines', [])|length != 0
       with_items: "{{ groups[rbdmirror_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - mgr_group_name in group_names
-        - not containerized_deployment
-        - hostvars[item]['_mgr_handler_called'] | default(False)
+        - not containerized_deployment | bool
+        - hostvars[item]['_mgr_handler_called'] | default(False) | bool
         - mgr_socket_stat.rc == 0
-        - not rolling_update
+        - not rolling_update | bool
       with_items: "{{ groups[mgr_group_name] }}"
       delegate_to: "{{ item }}"
       run_once: True
       when:
         # We do not want to run these checks on initial deployment (`socket.rc == 0`)
         - mgr_group_name in group_names
-        - containerized_deployment
+        - containerized_deployment | bool
         - ceph_mgr_container_stat.get('rc') == 0
-        - hostvars[item]['_mgr_handler_called'] | default(False)
+        - hostvars[item]['_mgr_handler_called'] | default(False) | bool
         - ceph_mgr_container_stat.get('stdout_lines', [])|length != 0
-        - not rolling_update
+        - not rolling_update | bool
       with_items: "{{ groups[mgr_group_name] }}"
       delegate_to: "{{ item }}"
       run_once: True
       when:
         - iscsi_gw_group_name in group_names
         - ceph_tcmu_runner_stat.get('rc') == 0
-        - hostvars[item]['_tcmu_runner_handler_called'] | default(False)
+        - hostvars[item]['_tcmu_runner_handler_called'] | default(False) | bool
         - ceph_tcmu_runner_stat.get('stdout_lines', [])|length != 0
       with_items: "{{ groups[iscsi_gw_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         - iscsi_gw_group_name in group_names
         - ceph_rbd_target_gw_stat.get('rc') == 0
-        - hostvars[item]['_rbd_target_gw_handler_called'] | default(False)
+        - hostvars[item]['_rbd_target_gw_handler_called'] | default(False) | bool
         - ceph_rbd_target_gw_stat.get('stdout_lines', [])|length != 0
       with_items: "{{ groups[iscsi_gw_group_name] }}"
       delegate_to: "{{ item }}"
       when:
         - iscsi_gw_group_name in group_names
         - ceph_rbd_target_api_stat.get('rc') == 0
-        - hostvars[item]['_rbd_target_api_handler_called'] | default(False)
+        - hostvars[item]['_rbd_target_api_handler_called'] | default(False) | bool
         - ceph_rbd_target_api_stat.get('stdout_lines', [])|length != 0
       with_items: "{{ groups[iscsi_gw_group_name] }}"
       delegate_to: "{{ item }}"
index 0f08a0ae36e8e25e1762290b6f0b216254f58404..633536d03514a68a5e7fe1b47e993e81a2a31ba1 100644 (file)
@@ -1,8 +1,8 @@
 ---
 - name: include check_running_containers.yml
   include_tasks: check_running_containers.yml
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: include check_socket_non_container.yml
   include_tasks: check_socket_non_container.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
index 2f6768263eb3e6ffb8c7521bce13788b0e453c18..b5dbaa682d03cc8194c92b18302aa007b70982e4 100644 (file)
@@ -8,10 +8,10 @@
   check_mode: no
   changed_when: false
   tags: firewall
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - when: (firewalld_pkg_query.get('rc', 1) == 0
-      or is_atomic)
+      or is_atomic | bool)
   block:
   - name: start firewalld
     service:
index ff0683980a5b7ecb9c1d813a3a514001d50f3d23..bbd3a84de77bc8d35779edc0bfcab5dbd27829e9 100644 (file)
@@ -2,11 +2,11 @@
 - name: include_tasks configure_firewall.yml
   include_tasks: configure_firewall.yml
   when:
-    - configure_firewall
+    - configure_firewall | bool
     - ansible_os_family in ['RedHat', 'Suse']
   tags: configure_firewall
 
 - name: include_tasks setup_ntp.yml
   include_tasks: setup_ntp.yml
-  when: ntp_service_enabled
+  when: ntp_service_enabled | bool
   tags: configure_ntp
index 7313b7b48e6d7a9c5c8bfe4b388301684ccf150d..775b1367dcd8a7fe7b02ac8de892f8724455c684 100644 (file)
@@ -2,7 +2,7 @@
 # Installation of NTP daemons needs to be a separate task since installations
 # can't happen on Atomic
 - name: install the ntp daemon
-  when: not is_atomic
+  when: not is_atomic | bool
   block:
     - name: install ntpd
       package:
index c5458eefc8e911566e82ce58bd7f7ca5f1fbb52b..73159f21ff63105cff7a4883140026b22cbf5d93 100644 (file)
@@ -11,7 +11,7 @@
     owner: "root"
     group: "root"
     mode: "{{ ceph_keyring_permissions }}"
-  when: cephx
+  when: cephx | bool
 
 - name: deploy gateway settings, used by the ceph_iscsi_config modules
   template:
@@ -22,7 +22,7 @@
   set_fact:
     container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: check if a rbd pool exists
   command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool ls --format json"
index f93ece72918d5be27e6d8c3c75b238684e0f5bac..c8364208fe714a016768ce82802eed70d13869a0 100644 (file)
@@ -4,19 +4,19 @@
 
 - name: include non-container/prerequisites.yml
   include_tasks: non-container/prerequisites.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 # deploy_ssl_keys used the ansible controller to create self-signed crt/key/pub files
 # and transfers them to /etc/ceph directory on each controller. SSL certs are used by
 # the API for https support.
 - name: include deploy_ssl_keys.yml
   include_tasks: deploy_ssl_keys.yml
-  when: generate_crt|bool
+  when: generate_crt | bool
 
 - name: include non-container/configure_iscsi.yml
   include_tasks: non-container/configure_iscsi.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: include containerized.yml
   include_tasks: container/containerized.yml
-  when: containerized_deployment
+  when: containerized_deployment | bool
index d311bb508308e54bb373181b914bf05028bb02e5..4fd2b65e23919cc460090515f7b039dc41592e2a 100644 (file)
@@ -6,7 +6,7 @@
       when:
         - ceph_origin == 'repository'
         - ceph_repository == 'dev'
-        - ceph_iscsi_config_dev
+        - ceph_iscsi_config_dev | bool
       block:
         - name: set_fact ceph_iscsi_repos
           set_fact:
index 634736b73b30d73731a79ed86ab35076b085e324..a537597306349fc990718bdd6bbddf7d1eaa05e8 100644 (file)
@@ -3,20 +3,20 @@
   include_tasks: create_mds_filesystems.yml
   when:
     - inventory_hostname == groups[mds_group_name] | first
-    - not rolling_update
+    - not rolling_update | bool
 
 - name: set_fact container_exec_cmd
   set_fact:
     container_exec_cmd: "{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: include common.yml
   include_tasks: common.yml
 
 - name: non_containerized.yml
   include_tasks: non_containerized.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: containerized.yml
   include_tasks: containerized.yml
-  when: containerized_deployment
+  when: containerized_deployment | bool
index 1accc900e04a328ec56fbd43fef4467791e96e63..cee9f8e8bf189e3e2b103d970c185f95d1d8979d 100644 (file)
@@ -64,7 +64,7 @@
         owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
         group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
-      when: cephx
+      when: cephx | bool
 
 - name: copy ceph keyring(s) if needed
   copy:
@@ -74,7 +74,7 @@
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   when:
-    - cephx
+    - cephx | bool
     - groups.get(mgr_group_name, []) | length > 0
     - copy_admin_key | bool
 
@@ -84,4 +84,4 @@
     owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
-  when: cephx
+  when: cephx | bool
index bce821b90afb65cd175120dfdd57d7b11054ec92..de706afd253908af3d7f8b0770da835575203855 100644 (file)
@@ -2,14 +2,14 @@
 - name: set_fact container_exec_cmd
   set_fact:
     container_exec_cmd_mgr: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: include common.yml
   include_tasks: common.yml
 
 - name: include pre_requisite.yml
   include_tasks: pre_requisite.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: include start_mgr.yml
   include_tasks: start_mgr.yml
index 8500651c94e6ab25a735e204f9627211d9ab6183..b243b1e145f2119a1589d00b87e5399bf028436c 100644 (file)
@@ -25,7 +25,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  when: containerized_deployment
+  when: containerized_deployment | bool
   notify: restart ceph mgrs
 
 - name: systemd start mgr
index 29377b4973de380dedff95d528b7ae4fc1d415c9..eaa5dd95e8800efb23ec2a5488a6b9d9973fa554 100644 (file)
@@ -17,7 +17,7 @@
   changed_when: false
 
 - name: tasks for MONs when cephx is enabled
-  when: cephx
+  when: cephx | bool
   block:
   - name: fetch ceph initial keys
     ceph_key:
index 87dd06695d6490caa1c091d71ffd3b0f1a0bc8d5..f49c98f9f8fb1c87f36b6aeb224f434ef9b8976f 100644 (file)
@@ -8,7 +8,7 @@
   register: config_crush_hierarchy
   when:
     - inventory_hostname == groups.get(mon_group_name) | last
-    - create_crush_tree
+    - create_crush_tree | bool
     - hostvars[item]['osd_crush_location'] is defined
 
 - name: create configured crush rules
index ea9b632e92f483983de84e27fe58fd889869e667..ef90ccb1c7b45f6e019eb6bbe51357715083499d 100644 (file)
@@ -48,7 +48,7 @@
     cp /var/lib/ceph/tmp/{{ cluster }}.mon..keyring
        /etc/ceph/{{ cluster }}.mon.keyring
   changed_when: false
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: create (and fix ownership of) monitor directory
   file:
@@ -75,7 +75,7 @@
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   register: create_custom_admin_secret
   when:
-    - cephx
+    - cephx | bool
     - admin_secret != 'admin_secret'
 
 - name: set_fact ceph-authtool container command
@@ -88,7 +88,7 @@
      /var/lib/ceph/tmp/{{ cluster }}.mon..keyring --import-keyring /etc/ceph/{{ cluster }}.client.admin.keyring
   when:
     - not create_custom_admin_secret.get('skipped')
-    - cephx
+    - cephx | bool
     - admin_secret != 'admin_secret'
 
 - name: set_fact ceph-mon container command
     --keyring /var/lib/ceph/tmp/{{ cluster }}.mon..keyring
   args:
     creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
-  when: cephx
+  when: cephx | bool
 
 - name: ceph monitor mkfs without keyring
   command: >
     --fsid {{ fsid }}
   args:
     creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/store.db
-  when: not cephx
+  when: not cephx | bool
index d8abf4333c2fdd819e78fd2744f85803f43e3457..7164ac89d4063d3d5ab2cdfd0aa63811f039ab25 100644 (file)
@@ -2,29 +2,28 @@
 - name: set_fact container_exec_cmd
   set_fact:
     container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: include deploy_monitors.yml
   include_tasks: deploy_monitors.yml
   when:
     # we test for both container and non-container
     - (mon_socket_stat is defined and mon_socket_stat.get('rc') != 0) or (ceph_mon_container_stat is defined and ceph_mon_container_stat.get('stdout_lines', [])|length == 0)
-    - not switch_to_containers | default(False)
+    - not switch_to_containers | default(False) | bool
 
 - name: include start_monitor.yml
   include_tasks: start_monitor.yml
 
 - name: include_tasks ceph_keys.yml
   include_tasks: ceph_keys.yml
-  when: not switch_to_containers | default(False)
+  when: not switch_to_containers | default(False) | bool
 
 - name: include secure_cluster.yml
   include_tasks: secure_cluster.yml
   when:
-    - secure_cluster
+    - secure_cluster | bool
     - inventory_hostname == groups[mon_group_name] | first
 
 - name: crush_rules.yml
   include_tasks: crush_rules.yml
-  when: crush_rule_config
-
+  when: crush_rule_config | bool
index f3ceadcabdd8c502036df85d754a6dd16fc6afce..dbf7d5198b15eade40e51300807dddb77f4b3dbd 100644 (file)
@@ -4,7 +4,7 @@
     state: directory
     path: "/etc/systemd/system/ceph-mon@.service.d/"
   when:
-    - not containerized_deployment
+    - not containerized_deployment | bool
     - ceph_mon_systemd_overrides is defined
     - ansible_service_mgr == 'systemd'
 
@@ -15,7 +15,7 @@
     config_overrides: "{{ ceph_mon_systemd_overrides | default({}) }}"
     config_type: "ini"
   when:
-    - not containerized_deployment
+    - not containerized_deployment | bool
     - ceph_mon_systemd_overrides is defined
     - ansible_service_mgr == 'systemd'
 
@@ -28,7 +28,7 @@
     group: "root"
     mode: "0644"
   notify: restart ceph mons
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: start the monitor service
   systemd:
index 6794ccd6079e1a997fbf0b32edd51db342cac2ec..cbdf5ec589ff1a80d532d6ccd2e7186386315ae1 100644 (file)
@@ -10,6 +10,6 @@
     - { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
     - { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
   when:
-    - cephx
-    - item.copy_key|bool
+    - cephx | bool
+    - item.copy_key | bool
     - groups.get(mon_group_name, []) | length > 0
index c6f9b350dc73279777c6268084b7d279b0961a07..5acacb08edae706024e30ca9dd6fa39882e5afd6 100644 (file)
@@ -2,7 +2,7 @@
 - name: set_fact container_exec_cmd_nfs
   set_fact:
     container_exec_cmd_nfs: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: check if "{{ ceph_nfs_rgw_user }}" exists
   command: "{{ container_exec_cmd_nfs | default('') }} radosgw-admin --cluster {{ cluster }} user info --uid={{ ceph_nfs_rgw_user }}"
@@ -11,7 +11,7 @@
   changed_when: false
   failed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when: nfs_obj_gw
+  when: nfs_obj_gw | bool
 
 - name: create rgw nfs user "{{ ceph_nfs_rgw_user }}"
   command: "{{ container_exec_cmd_nfs | default('') }} radosgw-admin --cluster {{ cluster }} user create --uid={{ ceph_nfs_rgw_user }} --display-name='RGW NFS User'"
@@ -20,7 +20,7 @@
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when:
-    - nfs_obj_gw
+    - nfs_obj_gw | bool
     - rgwuser_exists.get('rc', 1) != 0
 
 - name: set_fact ceph_nfs_rgw_access_key
@@ -28,7 +28,7 @@
     ceph_nfs_rgw_access_key: "{{ (rgwuser.stdout | from_json)['keys'][0]['access_key'] if rgwuser_exists.get('rc', 1) != 0 else (rgwuser_exists.stdout | from_json)['keys'][0]['access_key'] }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when:
-    - nfs_obj_gw
+    - nfs_obj_gw | bool
     - ceph_nfs_rgw_access_key is not defined
 
 - name: set_fact ceph_nfs_rgw_secret_key
@@ -36,5 +36,5 @@
     ceph_nfs_rgw_secret_key: "{{ (rgwuser.stdout | from_json)['keys'][0]['secret_key'] if rgwuser_exists.get('rc', 1) != 0 else (rgwuser_exists.stdout | from_json)['keys'][0]['secret_key'] }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when:
-    - nfs_obj_gw
+    - nfs_obj_gw | bool
     - ceph_nfs_rgw_secret_key is not defined
index 09766e68ee396f6a6c6e673840887a2606d8c35b..600da8522190f45d5bcf8fc785dd72b63146279a 100644 (file)
@@ -2,18 +2,18 @@
 - name: set_fact container_exec_cmd
   set_fact:
     container_exec_cmd: "{{ container_binary }} exec ceph-nfs-{{ ansible_hostname }}"
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: include common.yml
   include_tasks: common.yml
 
 - name: include pre_requisite_non_container.yml
   include_tasks: pre_requisite_non_container.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: include pre_requisite_container.yml
   include_tasks: pre_requisite_container.yml
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: include create_rgw_nfs_user.yml
   import_tasks: create_rgw_nfs_user.yml
@@ -23,7 +23,7 @@
 - name: include ganesha_selinux_fix.yml
   import_tasks: ganesha_selinux_fix.yml
   when:
-    - not containerized_deployment
+    - not containerized_deployment | bool
     - ansible_os_family == 'RedHat'
 
 - name: copy rgw keyring when deploying internal ganesha with external ceph cluster
index ead1e19f6c90416ad7e26357ce2c958f23177932..9008a2bf3d365038583b7f370da110894e016691 100644 (file)
@@ -5,7 +5,7 @@
       set_fact:
         admin_keyring:
           - "/etc/ceph/{{ cluster }}.client.admin.keyring"
-      when: copy_admin_key
+      when: copy_admin_key | bool
 
     - name: set_fact ceph_config_keys
       set_fact:
@@ -15,7 +15,7 @@
     - name: merge ceph_config_keys and admin_keyring
       set_fact:
         ceph_config_keys: "{{ ceph_config_keys + admin_keyring }}"
-      when: copy_admin_key
+      when: copy_admin_key | bool
 
     - name: stat for config and keys
       stat:
@@ -55,4 +55,4 @@
 
     - name: reload dbus configuration
       command: "killall -SIGHUP dbus-daemon"
-  when: ceph_nfs_dynamic_exports
+  when: ceph_nfs_dynamic_exports | bool
index 1b1868a2cf64d50da00bd0e23639ec03c9a8c897..0a1e8e2ed43fbe6d660f998b832b8b0ee3d172b1 100644 (file)
     - { name: "{{ rbd_client_admin_socket_path }}", create: "{{ nfs_obj_gw }}" }
     - { name: "/var/log/ceph", create: true }
     - { name: "/var/run/ceph", create: true }
-  when: item.create|bool
+  when: item.create | bool
 
 - name: cephx related tasks
   when:
-    - cephx
+    - cephx | bool
     - groups.get(mon_group_name, []) | length > 0
   block:
     - name: copy bootstrap cephx keys
         mode: "0600"
       with_items:
         - { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: "{{ nfs_obj_gw }}" }
-      when: item.copy_key|bool
+      when: item.copy_key | bool
 
     - name: nfs object gateway related tasks
-      when: nfs_obj_gw
+      when: nfs_obj_gw | bool
       block:
         - name: create rados gateway keyring
           command: ceph --cluster {{ cluster }} --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring
index 7c9c33fd8df1ce990a381abff52fce00f5ffe740..e72da9d304e987b8e617df2621b31cf88e901719 100644 (file)
@@ -4,7 +4,7 @@
   block:
     - name: stable repos specific tasks
       when:
-        - nfs_ganesha_stable
+        - nfs_ganesha_stable | bool
         - ceph_repository == 'community'
       block:
         - name: add nfs-ganesha stable repository
@@ -25,7 +25,7 @@
 
     - name: debian based systems - dev repos specific tasks
       when:
-        - nfs_ganesha_dev
+        - nfs_ganesha_dev | bool
         - ceph_repository == 'dev'
       block:
         - name: fetch nfs-ganesha development repository
             allow_unauthenticated: yes
           register: result
           until: result is succeeded
-          when: nfs_obj_gw
+          when: nfs_obj_gw | bool
         - name: install nfs rgw/cephfs gateway - debian
           apt:
             name: nfs-ganesha-ceph
             allow_unauthenticated: yes
           register: result
           until: result is succeeded
-          when: nfs_file_gw
+          when: nfs_file_gw | bool
 
     - name: debian based systems - rhcs installation
       when:
             state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
           register: result
           until: result is succeeded
-          when: nfs_file_gw
+          when: nfs_file_gw | bool
         - name: install red hat storage nfs obj gateway
           apt:
             name: nfs-ganesha-rgw
             state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
           register: result
           until: result is succeeded
-          when: nfs_obj_gw
+          when: nfs_obj_gw | bool
index 0e7aa959ac668db5fbe78ff5945353e28fed003a..5813778483db66fb26f73061a8f593be236fcc8a 100644 (file)
@@ -3,7 +3,7 @@
   - name: set_fact container_exec_cmd_nfs
     set_fact:
       container_exec_cmd_nfs: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-    when: containerized_deployment
+    when: containerized_deployment | bool
 
   - name: check if rados index object exists
     shell: "{{ container_exec_cmd_nfs | default('') }} rados -p {{ cephfs_data }} --cluster {{ cluster }} ls|grep {{ ceph_nfs_rados_export_index }}"
     failed_when: false
     register: rados_index_exists
     check_mode: no
-    when: ceph_nfs_rados_backend
+    when: ceph_nfs_rados_backend | bool
     delegate_to: "{{ groups[mon_group_name][0] }}"
     run_once: true
 
   - name: create an empty rados index object
     command: "{{ container_exec_cmd_nfs | default('') }} rados -p {{ cephfs_data }} --cluster {{ cluster }} put {{ ceph_nfs_rados_export_index }} /dev/null"
     when:
-      - ceph_nfs_rados_backend
+      - ceph_nfs_rados_backend | bool
       - rados_index_exists.rc != 0
     delegate_to: "{{ groups[mon_group_name][0] }}"
     run_once: true
@@ -48,7 +48,7 @@
     owner: "root"
     group: "root"
     mode: "0755"
-  when: ceph_nfs_dynamic_exports
+  when: ceph_nfs_dynamic_exports | bool
 
 - name: create exports dir index file
   copy:
@@ -58,7 +58,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  when: ceph_nfs_dynamic_exports
+  when: ceph_nfs_dynamic_exports | bool
 
 - name: generate systemd unit file
   become: true
@@ -68,7 +68,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  when: containerized_deployment
+  when: containerized_deployment | bool
   notify: restart ceph nfss
 
 - name: systemd start nfs container
@@ -79,8 +79,8 @@
     masked: no
     daemon_reload: yes
   when:
-    - containerized_deployment
-    - ceph_nfs_enable_service
+    - containerized_deployment | bool
+    - ceph_nfs_enable_service | bool
 
 - name: start nfs gateway service
   systemd:
@@ -89,5 +89,5 @@
     enabled: yes
     masked: no
   when:
-    - not containerized_deployment
-    - ceph_nfs_enable_service
+    - not containerized_deployment | bool
+    - ceph_nfs_enable_service | bool
index 2d5ff45ce0e20ee659c934ff18dcdcbe0554256e..9fa777c39dff4091d42dcac39eb10ef701f58545 100644 (file)
@@ -6,7 +6,7 @@
     owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "0755"
-  when: cephx
+  when: cephx | bool
   with_items:
     - /var/lib/ceph/bootstrap-osd/
     - /var/lib/ceph/osd/
@@ -22,5 +22,5 @@
     - { name: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
     - { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
   when:
-    - cephx
-    - item.copy_key|bool
+    - cephx | bool
+    - item.copy_key | bool
index 01590f37e87a03b2eb4296066a5218d44bf545a3..ea4265e76a3831c8900403e58737f146941b55be 100644 (file)
@@ -3,30 +3,30 @@
   set_fact:
     docker_env_args: -e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=0
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - osd_objectstore == 'filestore'
-    - not dmcrypt
+    - not dmcrypt | bool
 
 - name: set_fact docker_env_args '-e osd_bluestore=0 -e osd_filestore=1 -e osd_dmcrypt=1'
   set_fact:
     docker_env_args: -e OSD_BLUESTORE=0 -e OSD_FILESTORE=1 -e OSD_DMCRYPT=1
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - osd_objectstore == 'filestore'
-    - dmcrypt
+    - dmcrypt | bool
 
 - name: set_fact docker_env_args '-e osd_bluestore=1 -e osd_filestore=0 -e osd_dmcrypt=0'
   set_fact:
     docker_env_args: -e OSD_BLUESTORE=1 -e OSD_FILESTORE=0 -e OSD_DMCRYPT=0
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - osd_objectstore == 'bluestore'
-    - not dmcrypt
+    - not dmcrypt | bool
 
 - name: set_fact docker_env_args '-e osd_bluestore=1 -e osd_filestore=0 -e osd_dmcrypt=1'
   set_fact:
     docker_env_args: -e OSD_BLUESTORE=1 -e OSD_FILESTORE=0 -e OSD_DMCRYPT=1
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - osd_objectstore == 'bluestore'
-    - dmcrypt
+    - dmcrypt | bool
index a68ec560cdc24aa9c2ac4a6aad0da4cd3331d633..aebea8157596fb82ce3581142533a45957304dc9 100644 (file)
@@ -9,7 +9,7 @@
   register: result
   until: result is succeeded
   when:
-    - not containerized_deployment
+    - not containerized_deployment | bool
     - ansible_os_family != 'ClearLinux'
 
 - name: install numactl when needed
@@ -18,7 +18,7 @@
   register: result
   until: result is succeeded
   when:
-    - containerized_deployment
+    - containerized_deployment | bool
     - ceph_osd_numactl_opts != ""
   tags: with_pkg
 
@@ -27,7 +27,7 @@
     name: lvm2
   register: result
   until: result is succeeded
-  when: not is_atomic
+  when: not is_atomic | bool
   tags: with_pkg
 
 - name: include_tasks common.yml
   include_tasks: scenarios/lvm.yml
   when:
     - lvm_volumes|length > 0
-    - not rolling_update|default(False)
+    - not rolling_update|default(False) | bool
 
 - name: include_tasks scenarios/lvm-batch.yml
   include_tasks: scenarios/lvm-batch.yml
   when:
     - devices|length > 0
-    - not rolling_update|default(False)
+    - not rolling_update|default(False) | bool
 
 - name: include_tasks start_osds.yml
   include_tasks: start_osds.yml
@@ -63,8 +63,8 @@
     openstack_keys_tmp: "{{ openstack_keys_tmp|default([]) + [ { 'key': item.key, 'name': item.name, 'caps': { 'mon': item.mon_cap, 'osd': item.osd_cap|default(''), 'mds': item.mds_cap|default(''), 'mgr': item.mgr_cap|default('') } , 'mode': item.mode } ] }}"
   with_items: "{{ openstack_keys }}"
   when:
-    - not add_osd|default(False)
-    - openstack_config
+    - not add_osd|default(False) | bool
+    - openstack_config | bool
     - item.get('mon_cap', None)
     # it's enough to assume we are running an old-fashionned syntax simply by checking the presence of mon_cap since every key needs this cap
 
   set_fact:
     openstack_keys: "{{ openstack_keys_tmp }}"
   when:
-    - not add_osd|default(False)
+    - not add_osd|default(False) | bool
     - openstack_keys_tmp is defined
 
 # Create the pools listed in openstack_pools
 - name: include openstack_config.yml
   include_tasks: openstack_config.yml
   when:
-    - not add_osd|default(False)
-    - openstack_config
+    - not add_osd|default(False) | bool
+    - openstack_config | bool
     - inventory_hostname == groups[osd_group_name] | last
index 0a28e54f355881a062b4f4d0e2ef57e48fdd973e..9a0a8db8451118a6ff751865815790a9646eb796 100644 (file)
@@ -79,7 +79,7 @@
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   with_items: "{{ openstack_keys }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when: cephx
+  when: cephx | bool
 
 - name: fetch openstack cephx key(s)
   fetch:
     - "{{ openstack_keys }}"
   delegate_to: "{{ item.0 }}"
   when:
-    - cephx
-    - openstack_config
+    - cephx | bool
+    - openstack_config | bool
     - item.0 != groups[mon_group_name]
index a9e0fb85b5a94185d8fd7e3b5b45fcd956ecb3ce..d7c135c6b6ab9a62320d0a14ae2d54c9fb32dc5d 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: container specific tasks
-  when: containerized_deployment
+  when: containerized_deployment | bool
   block:
   - name: umount ceph disk (if on openstack)
     mount:
@@ -8,7 +8,7 @@
       src: /dev/vdb
       fstype: ext3
       state: unmounted
-    when: ceph_docker_on_openstack
+    when: ceph_docker_on_openstack | bool
 
   - name: generate ceph osd docker run script
     become: true
@@ -47,7 +47,7 @@
     group: "root"
     mode: "0644"
   notify: restart ceph osds
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: systemd start osd
   systemd:
index 4087317be6f7e78f5720dcec63831bf61706b8a4..21ff94d2809e218046851660b356b652b9dfc8df 100644 (file)
@@ -23,7 +23,7 @@
     group: "root"
     mode: "0755"
   register: "tmpfiles_d"
-  when: disable_transparent_hugepage
+  when: disable_transparent_hugepage | bool
 
 - name: disable transparent hugepage
   template:
@@ -34,7 +34,7 @@
     mode: "0644"
     force: "yes"
     validate: "systemd-tmpfiles --create %s"
-  when: disable_transparent_hugepage
+  when: disable_transparent_hugepage | bool
 
 - name: get default vm.min_free_kbytes
   command: sysctl -b vm.min_free_kbytes
@@ -58,4 +58,4 @@
   with_items:
     - { name: "fs.aio-max-nr", value: "1048576", enable: (osd_objectstore == 'bluestore') }
     - "{{ os_tuning_params }}"
-  when: item.enable | default(true)
+  when: item.enable | default(true) | bool
index a9a7e32c0f561fe5154823bf8df82f6069997b73..a679bdbae757a6ca7d8a844bbe7e48e8d5b1ac63 100644 (file)
@@ -18,7 +18,7 @@
     -o /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
   args:
     creates: /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: set rbd-mirror key permissions
   file:
@@ -26,4 +26,4 @@
     owner: "ceph"
     group: "ceph"
     mode: "{{ ceph_keyring_permissions }}"
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
index e099b9ef2439b1e01d249c077bc61dfea60ec19b..c2981006962d6e459916645c5c8bf09b09abcf23 100644 (file)
@@ -1,24 +1,24 @@
 ---
 - name: include pre_requisite.yml
   include_tasks: pre_requisite.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: include common.yml
   include_tasks: common.yml
-  when: cephx
+  when: cephx | bool
 
 - name: tasks for non-containerized deployment
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
   block:
     - name: include start_rbd_mirror.yml
       include_tasks: start_rbd_mirror.yml
 
     - name: include configure_mirroring.yml
       include_tasks: configure_mirroring.yml
-      when: ceph_rbd_mirror_configure
+      when: ceph_rbd_mirror_configure | bool
 
 - name: tasks for containerized deployment
-  when: containerized_deployment
+  when: containerized_deployment | bool
   block:
     - name: set_fact container_exec_cmd
       set_fact:
index b40573e84a9d33ed85069746bc97a38dcc0678b5..be5f24ee92ddb40af21c1516a661e8dd8b0c8210 100644 (file)
@@ -29,5 +29,5 @@
     - { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
     - { name: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
   when:
-    - cephx
-    - item.copy_key|bool
+    - cephx | bool
+    - item.copy_key | bool
index b3221f0b4a9c327a6abb58a4bfd70d11062cd766..84ca62ff4dcbb351917a83646c31c51ee8d56614 100644 (file)
@@ -4,23 +4,23 @@
 
 - name: include_tasks pre_requisite.yml
   include_tasks: pre_requisite.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: include_tasks openstack-keystone.yml
   include_tasks: openstack-keystone.yml
-  when: radosgw_keystone_ssl|bool
+  when: radosgw_keystone_ssl | bool
 
 - name: include_tasks start_radosgw.yml
   include_tasks: start_radosgw.yml
-  when: not containerized_deployment
+  when: not containerized_deployment | bool
 
 - name: include_tasks docker/main.yml
   include_tasks: docker/main.yml
-  when: containerized_deployment
+  when: containerized_deployment | bool
 
 - name: include_tasks multisite/main.yml
   include_tasks: multisite/main.yml
-  when: rgw_multisite
+  when: rgw_multisite | bool
 
 - name: rgw pool related tasks
   when: rgw_create_pools is defined
index 40b884f8d10dbfe0a9042ef8638ae04555a8d94c..18a6468482244a5b797da2a96b36c17285f4c945 100644 (file)
@@ -6,14 +6,14 @@
 - name: include_tasks master.yml
   include_tasks: master.yml
   when:
-    - rgw_zonemaster
-    - not rgw_zonesecondary
+    - rgw_zonemaster | bool
+    - not rgw_zonesecondary | bool
 
 - name: include_tasks secondary.yml
   include_tasks: secondary.yml
   when:
-    - not rgw_zonemaster
-    - rgw_zonesecondary
+    - not rgw_zonemaster | bool
+    - rgw_zonesecondary | bool
 
 # Continue with common tasks
 - name: add zone to rgw stanza in ceph.conf
index 96d08a18c7ada0820930c15cdc97186f0018db43..29c1e2e8045a22dc68ade93ab67f1a44f439b9d5 100644 (file)
@@ -5,7 +5,7 @@
     creates: /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}/keyring
   changed_when: false
   with_items: "{{ rgw_instances }}"
-  when: cephx
+  when: cephx | bool
 
 - name: set rados gateway instance key permissions
   file:
@@ -14,4 +14,4 @@
     group: "ceph"
     mode: "0600"
   with_items: "{{ rgw_instances }}"
-  when: cephx
+  when: cephx | bool
index bda480c9cb7a3912a89e7d17021de8e0149aa60b..fb407ff53c27f4d13648b310498743b157b398e4 100644 (file)
@@ -7,8 +7,8 @@
   fail:
     msg: "fqdn configuration is not supported anymore. Use 'use_fqdn_yes_i_am_sure: true' if you really want to use it. See release notes for more details"
   when:
-    - mon_use_fqdn or mds_use_fqdn
-    - not use_fqdn_yes_i_am_sure
+    - mon_use_fqdn | bool or mds_use_fqdn | bool
+    - not use_fqdn_yes_i_am_sure | bool
 
 - name: debian based systems tasks
   when: ansible_os_family == 'Debian'
@@ -31,7 +31,7 @@
   fail:
     msg: "ntp_daemon_type must be one of chronyd, ntpd, or timesyncd"
   when:
-    - ntp_service_enabled
+    - ntp_service_enabled | bool
     - ntp_daemon_type not in ['chronyd', 'ntpd', 'timesyncd']
 
 # Since NTPd can not be installed on Atomic...
@@ -39,7 +39,7 @@
   fail:
     msg: installation can't happen on Atomic and ntpd needs to be installed
   when:
-    - is_atomic | default(False)
+    - is_atomic | default(False) | bool
     - ansible_os_family == 'RedHat'
     - ntp_daemon_type == 'ntpd'
 
@@ -58,7 +58,7 @@
   include_tasks: check_devices.yml
   when:
     - osd_group_name in group_names
-    - not osd_auto_discovery | default(False)
+    - not osd_auto_discovery | default(False) | bool
     - devices|default([])|length > 0
 
 - name: include check_eth_mon.yml
@@ -89,7 +89,7 @@
   include_tasks: check_rgw_multisite.yml
   when:
     - inventory_hostname in groups.get(rgw_group_name, [])
-    - rgw_multisite
+    - rgw_multisite | bool
 
 - name: include check_iscsi.yml
   include_tasks: check_iscsi.yml
index f6845de85cff06ab686c05d5d1a61f56bff17342..0a044b300af3d7e6effdc75fd4a7303318469637 100644 (file)
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
       when: inventory_hostname == groups.get('clients', ['']) | first
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
         name: ceph-container-common
     - import_role:
         name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
           name: ceph-prometheus
       - import_role:
           name: ceph-grafana
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
 
 - hosts: '{{ (groups["grafana-server"] | default(groups["mgrs"]) | default(groups["mons"]))[0] | default(omit) }}'
   become: true
           tags: ['ceph_update_config']
         - import_role:
             name: ceph-dashboard
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
index d8726ecf5208110804698a8c3e60e77b7eaa519a..d00f9534504894b0cee7b8e9c161e03c0c007c46 100644 (file)
             name: ceph-container-engine
         - import_role:
             name: ceph-node-exporter
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
 
 
 - hosts: grafana-server
             name: ceph-prometheus
         - import_role:
             name: ceph-grafana
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
 
 - hosts: '{{ (groups["grafana-server"] | default(groups["mgrs"]) | default(groups["mons"]))[0] | default(omit) }}'
   become: true
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
     - import_role:
         name: ceph-dashboard
-      when: dashboard_enabled
+      when: dashboard_enabled | bool
index e6deb9d8f679dbe46b0dc6deece54e2bcb610487..afb5f27968018f7d7abe432041be69855374c7ff 100644 (file)
@@ -25,7 +25,7 @@
         state: present
       register: result
       until: result is succeeded
-      when: not is_atomic
+      when: not is_atomic | bool
     - name: create physical volume
       command: pvcreate /dev/sdb
       failed_when: false
index b354f9ac0ae8c1df82c87ba5a380bc9201b686e8..222c3801e688e41a964ab2c3a5671827899680cc 100644 (file)
         state: present
       register: result
       until: result is succeeded
-      when: not is_atomic
+      when: not is_atomic | bool
 
     - name: generate and upload a random 10Mb file - containerized deployment
       command: >
         docker run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c 'dd if=/dev/urandom of=/tmp/testinfra.img bs=1M count=10; {{ s3cmd_cmd }} mb s3://testinfra; {{ s3cmd_cmd }} put /tmp/testinfra.img s3://testinfra'
       when:
-        - rgw_zonemaster
-        - containerized_deployment | default(False)
+        - rgw_zonemaster | bool
+        - containerized_deployment | default(False) | bool
 
     - name: generate and upload a random a 10Mb file - non containerized
       shell: >
         {{ s3cmd_cmd }} mb s3://testinfra;
         {{ s3cmd_cmd }} put /tmp/testinfra.img s3://testinfra
       when:
-        - rgw_zonemaster | default(False)
-        - not containerized_deployment | default(False)
+        - rgw_zonemaster | default(False) | bool
+        - not containerized_deployment | default(False) | bool
 
     - name: get info from replicated file - containerized deployment
       command: >
         docker run --rm --name=rgw_multisite_test --entrypoint=/bin/bash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} -c '{{ s3cmd_cmd }} info s3://testinfra/testinfra.img'
       register: s3cmd_info_status
       when:
-        - not rgw_zonemaster | default(False)
-        - containerized_deployment | default(False)
+        - not rgw_zonemaster | default(False) | bool
+        - containerized_deployment | default(False) | bool
       retries: 10
       delay: 2
       until: s3cmd_info_status.get('rc', 1) == 0
@@ -55,8 +55,8 @@
         {{ s3cmd_cmd }} info s3://testinfra/testinfra.img
       register: s3cmd_info_status
       when:
-        - not rgw_zonemaster | default(False)
-        - not containerized_deployment | default(False)
+        - not rgw_zonemaster | default(False) | bool
+        - not containerized_deployment | default(False) | bool
       retries: 10
       delay: 2
       until: s3cmd_info_status.get('rc', 1) == 0
index a7b87aecbe4dc786c1193fb250c3cde5ed4c9205..14804669b440cb79e40573944b73966a3b69baae 100644 (file)
@@ -64,7 +64,7 @@
         dest: /etc/yum.repos.d
         owner: root
         group: root
-      when: not is_atomic
+      when: not is_atomic | bool
 
     - name: enable the rhel-7-extras-nightly repo
       command: "yum-config-manager --enable rhel-7-extras-nightly"
         baseurl: "{{ repo_url }}/MON/x86_64/os/"
         gpgcheck: no
         enabled: yes
-      when: not is_atomic
+      when: not is_atomic | bool
 
 - hosts: osds
   gather_facts: false
         baseurl: "{{ repo_url }}/OSD/x86_64/os/"
         gpgcheck: no
         enabled: yes
-      when: not is_atomic
+      when: not is_atomic | bool
 
     - name: set MTU on eth2
       command: "ifconfig eth2 mtu 1400 up"
         baseurl: "{{ repo_url }}/Tools/x86_64/os/"
         gpgcheck: no
         enabled: yes
-      when: not is_atomic
+      when: not is_atomic | bool
index 9648a57b240c0756c00f42fae611abb0c88751f1..8de4fbed387cffba104f351e088ce35594162d8d 100644 (file)
@@ -36,7 +36,7 @@
         state: present
       register: result
       until: result is succeeded
-      when: not is_atomic
+      when: not is_atomic | bool
 
     - name: centos based systems - configure repos
       block:
@@ -66,7 +66,7 @@
             state: absent
       when:
         - ansible_distribution == 'CentOS'
-        - not is_atomic
+        - not is_atomic | bool
 
     - name: resize logical volume for root partition to fill remaining free space
       lvol:
@@ -74,4 +74,4 @@
         vg: atomicos
         size: +100%FREE
         resizefs: yes
-      when: is_atomic
+      when: is_atomic | bool