]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
add missing boolean filter
authorDimitri Savineau <dsavinea@redhat.com>
Fri, 25 Sep 2020 16:15:02 +0000 (12:15 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 28 Sep 2020 18:45:01 +0000 (20:45 +0200)
Otherwise this will generate an ansible warning about the missing
filter.

[DEPRECATION WARNING]: evaluating xxx 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.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
46 files changed:
infrastructure-playbooks/filestore-to-bluestore.yml
infrastructure-playbooks/rolling_update.yml
infrastructure-playbooks/shrink-osd.yml
infrastructure-playbooks/storage-inventory.yml
roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-client/tasks/pre_requisite.yml
roles/ceph-common/tasks/installs/install_debian_packages.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install.yml
roles/ceph-common/vars/main.yml
roles/ceph-config/tasks/main.yml
roles/ceph-config/tasks/rgw_systemd_environment_file.yml
roles/ceph-config/templates/ceph.conf.j2
roles/ceph-crash/tasks/main.yml
roles/ceph-facts/tasks/facts.yml
roles/ceph-handler/templates/restart_mds_daemon.sh.j2
roles/ceph-handler/templates/restart_mgr_daemon.sh.j2
roles/ceph-handler/templates/restart_mon_daemon.sh.j2
roles/ceph-handler/templates/restart_nfs_daemon.sh.j2
roles/ceph-handler/templates/restart_osd_daemon.sh.j2
roles/ceph-handler/templates/restart_rbd_mirror_daemon.sh.j2
roles/ceph-iscsi-gw/tasks/common.yml
roles/ceph-mds/tasks/common.yml
roles/ceph-mds/tasks/create_mds_filesystems.yml
roles/ceph-mds/tasks/non_containerized.yml
roles/ceph-mgr/tasks/common.yml
roles/ceph-mgr/tasks/main.yml
roles/ceph-mgr/tasks/pre_requisite.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/tasks/start_monitor.yml
roles/ceph-mon/templates/ceph-mon.service.j2
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_red_hat.yml
roles/ceph-nfs/templates/ceph-nfs.service.j2
roles/ceph-nfs/templates/ganesha.conf.j2
roles/ceph-osd/tasks/common.yml
roles/ceph-osd/tasks/openstack_config.yml
roles/ceph-osd/tasks/scenarios/lvm-batch.yml
roles/ceph-osd/tasks/scenarios/lvm.yml
roles/ceph-osd/tasks/start_osds.yml
roles/ceph-rbd-mirror/tasks/common.yml
roles/ceph-rgw/tasks/common.yml
roles/ceph-rgw/tasks/rgw_create_pools.yml
roles/ceph-validate/tasks/check_nfs.yml

index 1ed6208df9bcdc49dc0f90628ef6b6d455989b6e..fd9a870e1f74440fe25042ddc553bacbea181aff 100644 (file)
@@ -48,7 +48,7 @@
 
         - name: set_fact container_run_cmd
           set_fact:
-            container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else '' }}"
+            container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment | bool else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else '' }}"
 
         - name: get ceph-volume lvm inventory data
           command: "{{ container_run_cmd }} --cluster {{ cluster }} inventory --format json"
                 destroy: false
               environment:
                 CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-                CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+                CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
                 CEPH_CONTAINER_BINARY: "{{ container_binary }}"
               loop: "{{ osd_fsid_list }}"
               when: osd_fsid_list is defined
                 destroy: true
               environment:
                 CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-                CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+                CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
                 CEPH_CONTAINER_BINARY: "{{ container_binary }}"
               loop: "{{ osd_fsid_list }}"
               when:
index 9973268ec94e47cd47bbf983d8ed4fde7f91ee48..dc7065925f308a9344e1bf8164e10bebebe1787c 100644 (file)
     - name: ensure /var/lib/ceph/bootstrap-rbd-mirror is present
       file:
         path: /var/lib/ceph/bootstrap-rbd-mirror
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: '755'
         state: directory
       delegate_to: "{{ item }}"
         - ['bootstrap-rbd', 'bootstrap-rbd-mirror']
         - "{{ groups[mon_group_name] }}" # so the key goes on all the nodes
       environment:
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       when:
         - cephx | bool
index b4bb69af13387b656e5c02ce9bf156f299e575a5..1c245165de443c74d1a28ee00beb6c87acbe1de9 100644 (file)
@@ -70,7 +70,7 @@
 
     - name: set_fact container_run_cmd
       set_fact:
-        container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else '' }}"
+        container_run_cmd: "{{ container_binary + ' run --rm --privileged=true --net=host --pid=host --ipc=host -v /dev:/dev -v /etc/ceph:/etc/ceph -v /var/lib/ceph:/var/lib/ceph -v /var/run:/var/run --entrypoint=' if containerized_deployment | bool else '' }}ceph-volume {{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else '' }}"
 
     - name: exit playbook, if can not connect to the cluster
       command: "{{ container_exec_cmd }} timeout 5 ceph --cluster {{ cluster }} health"
         osd_fsid: "{{ item.1 }}"
       environment:
         CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       delegate_to: "{{ item.0 }}"
       loop: "{{ _osd_hosts }}"
index 708262ec63c1f94d64ab014e2b757f6543e1e85e..00eb3f29bd77d43d1fa14b9bfa238e93eb8bc48b 100644 (file)
@@ -29,5 +29,5 @@
         action: "inventory"
       environment:
         CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
index e65341339911c712bc131a68286227a2392ca7de..47cc60bb2166fc5abf7dddc687f98134080a0dcf 100644 (file)
     dest: "{{ ceph_conf_key_directory }}"
     import_key: "{{ admin_key_presence }}"
     mode: "{{ item.mode|default(omit) }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   with_items:
     - "{{ keys }}"
@@ -87,7 +87,7 @@
         target_size_ratio: "{{ item.target_size_ratio | default(omit) }}"
         application: "{{ item.application | default(omit) }}"
       environment:
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       with_items: "{{ pools }}"
       changed_when: false
index 69735237735047975c6b19a62b556d1a688ec8e0..5ebf2422905db7e6902775d39280d861cea454a4 100644 (file)
@@ -16,8 +16,8 @@
       copy:
         dest: "{{ item.item.path }}"
         content: "{{ item.stdout + '\n' }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
       with_items: "{{ _client_keys.results }}"
       when:
index 6bdc03f4ab1c580aa583d485a69c9d23f976ab04..f72ff82f84fb311a2f34e88d0294bf584ce9f68d 100644 (file)
@@ -4,6 +4,6 @@
     name: "{{ debian_ceph_pkgs | unique }}"
     update_cache: no
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
-    default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else '' }}"
+    default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
   register: result
   until: result is succeeded
index 0b7783a4cf54eca001c9c0f7636cd06553ed7a3b..f0899d6ced40bf54e1436011fba23e3a58472840 100644 (file)
@@ -33,7 +33,7 @@
 - name: copy red hat storage iso content for redhat systems
   shell: cp -r {{ ceph_rhcs_mount_path }}/* {{ ceph_rhcs_repository_path }}
   args:
-    creates: "{{ ceph_rhcs_repository_path+'/README' if not rolling_update else 'dummy' }}"
+    creates: "{{ ceph_rhcs_repository_path+'/README' if not rolling_update | bool else 'dummy' }}"
 
 - name: unmount red hat storage iso file for redhat systems
   mount:
index cbd5a5f52eb0ef68a533ab7902dd92b750e87e53..d4aead75aafd4cbc1a5441f97891cd84623e6002 100644 (file)
@@ -6,12 +6,12 @@ debian_ceph_pkgs:
   - "ceph-common"
   - "{{ ((ceph_repository == 'rhcs') and (mon_group_name in group_names)) | ternary('ceph-mon', 'ceph-common') }}"
   - "{{ ((ceph_repository == 'rhcs') and (osd_group_name in group_names)) | ternary('ceph-osd', 'ceph-common') }}"
-  - "{{ (ceph_test) | ternary('ceph-test', 'ceph-common') }}"
+  - "{{ (ceph_test | bool) | ternary('ceph-test', 'ceph-common') }}"
   - "{{ (rgw_group_name in group_names) | ternary('radosgw', 'ceph-common') }}"
   - "{{ ((ceph_repository == 'rhcs') and (client_group_name in group_names)) | ternary('ceph-fuse', 'ceph-common') }}"
 
 redhat_ceph_pkgs:
-  - "{{ (ceph_test) | ternary('ceph-test', 'ceph-common') }}"
+  - "{{ (ceph_test | bool) | ternary('ceph-test', 'ceph-common') }}"
   - "ceph-common"
   - "{{ (mon_group_name in group_names) | ternary('ceph-mon', 'ceph-common') }}"
   - "{{ (osd_group_name in group_names) | ternary('ceph-osd', 'ceph-common') }}"
@@ -20,7 +20,7 @@ redhat_ceph_pkgs:
   - "{{ (rgw_group_name in group_names) | ternary('ceph-radosgw', 'ceph-common') }}"
 
 suse_ceph_pkgs:
-  - "{{ (ceph_test) | ternary('ceph-test', 'ceph-common') }}"
+  - "{{ (ceph_test | bool) | ternary('ceph-test', 'ceph-common') }}"
   - "ceph-common"
   - "{{ (mon_group_name in group_names) | ternary('ceph-mon', 'ceph-common') }}"
   - "{{ (osd_group_name in group_names) | ternary('ceph-osd', 'ceph-common') }}"
index 74856b51b38699798d8910f73cadb7396ee250dd..e56d9e09afa83bb03fe4b93d6ec388b569b92986 100644 (file)
@@ -27,7 +27,7 @@
         register: rejected_devices
         environment:
           CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-          CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+          CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
           CEPH_CONTAINER_BINARY: "{{ container_binary }}"
           PYTHONIOENCODING: utf-8
 
@@ -54,7 +54,7 @@
         register: lvm_batch_report
         environment:
           CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-          CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+          CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
           CEPH_CONTAINER_BINARY: "{{ container_binary }}"
           PYTHONIOENCODING: utf-8
         when: _devices | default([]) | length > 0
@@ -74,7 +74,7 @@
     register: lvm_list
     environment:
       CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-      CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+      CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
       CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       PYTHONIOENCODING: utf-8
     changed_when: false
index ee310f11084a102e057a693f7744933099da48de..54addc65b150dc625a14507d7c802097d78e0f8e 100644 (file)
@@ -3,8 +3,8 @@
   file:
     path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}.{{ item.instance_name }}"
     state: directory
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_directories_mode | default('0755') }}"
   with_items: "{{ rgw_instances }}"
 
index 0b0588bd96e1ffec9a6fafff1802810ecac571d0..1fdb764311f9165f48189361c982c644a7fad62e 100644 (file)
@@ -2,7 +2,7 @@
 # {{ ansible_managed }}
 
 [global]
-{% if not cephx %}
+{% if not cephx | bool %}
 auth cluster required = none
 auth service required = none
 auth client required = none
@@ -82,7 +82,7 @@ filestore xattr use omap = true
 {% if osd_objectstore == 'bluestore' %}
 {% set _num_osds = num_osds | default(0) | int %}
 [osd]
-{% if is_hci and _num_osds > 0 %}
+{% if is_hci | bool and _num_osds > 0 %}
 {# hci_safety_factor is the safety factor for HCI deployments #}
 {% if ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds > osd_memory_target %}
 {% set _osd_memory_target = (ansible_memtotal_mb * 1048576 * hci_safety_factor / _num_osds) | int %}
@@ -130,7 +130,7 @@ rgw_zone = {{ instance['rgw_zone'] }}
 {% if inventory_hostname in groups.get(nfs_group_name, []) and inventory_hostname not in groups.get(rgw_group_name, []) %}
 {% for host in groups[nfs_group_name] %}
 {% set _rgw_hostname = hostvars[host]['rgw_hostname'] | default(hostvars[host]['ansible_hostname']) %}
-{% if nfs_obj_gw %}
+{% if nfs_obj_gw | bool %}
 [client.rgw.{{ _rgw_hostname }}]
 host = {{ _rgw_hostname }}
 keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ _rgw_hostname }}/keyring
index e27bc796584b4d808d9b60c7067c14727f4b24ac..0457302d5ae2fdacbbe862c08e3846269b8c31ad 100644 (file)
         dest: "{{ ceph_conf_key_directory }}"
         import_key: True
         mode: "{{ ceph_keyring_permissions }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
       environment:
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
       run_once: True
@@ -40,8 +40,8 @@
       copy:
         dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.client.crash.keyring"
         content: "{{ _crash_keys.stdout + '\n' }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
       with_items: "{{ list_target_node }}"
       delegate_to: "{{ item }}"
index 654a59dcfdda296db27d7b2cba3c6ce303e49431..a2c59847d2c015ab7f60ef60938a4b28389ea92d 100644 (file)
@@ -38,7 +38,7 @@
   block:
     - 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'] }}"
+        container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] if not rolling_update | bool else hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}"
       when:
         - containerized_deployment | bool
 
   set_fact:
     current_fsid:
       rc: 1
-  when: rolling_update or groups.get(mon_group_name, []) | length == 0
+  when: rolling_update | bool or groups.get(mon_group_name, []) | length == 0
 
 - name: create a local fetch directory if it does not exist
   file:
 
 - name: set_fact ceph_run_cmd
   set_fact:
-    ceph_run_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph' }}"
+    ceph_run_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph' }}"
   delegate_to: "{{ item }}"
   delegate_facts: True
   run_once: True
index 66038a443f6aedcaefc6e9ec590c0151bb967dbf..8a36032aad00b3787bdc77f015a5ee11e9f9fb94 100644 (file)
@@ -3,7 +3,7 @@
 RETRIES="{{ handler_health_mds_check_retries }}"
 DELAY="{{ handler_health_mds_check_delay }}"
 MDS_NAME="{{ ansible_hostname }}"
-{% if containerized_deployment %}
+{% if containerized_deployment | bool %}
 DOCKER_EXEC="{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
 {% endif %}
 
index c9f3554003e7041cca2baf239acff13fef7dabf8..d5a7156892c605c1ab8fdb6bc758f82212e7bc13 100644 (file)
@@ -3,7 +3,7 @@
 RETRIES="{{ handler_health_mgr_check_retries }}"
 DELAY="{{ handler_health_mgr_check_delay }}"
 MGR_NAME="{{ ansible_hostname }}"
-{% if containerized_deployment %}
+{% if containerized_deployment | bool %}
 DOCKER_EXEC="{{ container_binary }} exec ceph-mgr-{{ ansible_hostname }}"
 {% endif %}
 
index e8344cbef29d19f3a65719440be5a780da2b23cb..6d5ee611e32df47dba574c9e453b872ebcf34c7b 100644 (file)
@@ -3,7 +3,7 @@
 RETRIES="{{ handler_health_mon_check_retries }}"
 DELAY="{{ handler_health_mon_check_delay }}"
 MONITOR_NAME="{{ monitor_name }}"
-{% if containerized_deployment %}
+{% if containerized_deployment | bool %}
 DOCKER_EXEC="{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
 {% endif %}
 
index 0fab87cc0900b1e8794d266e16fb2d81f35bd95e..c76432a3496fb9e3e1f05ae631174a2cb49699cb 100644 (file)
@@ -4,12 +4,12 @@ RETRIES="{{ handler_health_nfs_check_retries }}"
 DELAY="{{ handler_health_nfs_check_delay }}"
 NFS_NAME="ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}"
 PID=/var/run/ganesha.pid
-{% if containerized_deployment %}
+{% if containerized_deployment | bool %}
 DOCKER_EXEC="{{ container_binary }} exec ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }}"
 {% endif %}
 
 # First, restart the daemon
-{% if containerized_deployment -%}
+{% if containerized_deployment | bool -%}
 systemctl restart $NFS_NAME
 # Wait and ensure the pid exists after restarting the daemon
 while [ $RETRIES -ne 0 ]; do
index 597baaacd0db72fdd439effec457b09b174243c1..51d2d10ab6bfee6de6201a169d6818f8910ba790 100644 (file)
@@ -61,7 +61,7 @@ for unit in $(systemctl list-units | grep -E "loaded * active" | grep -oE "ceph-
   # We need to wait because it may take some time for the socket to actually exists
   COUNT=10
   # Wait and ensure the socket exists after restarting the daemon
-  {% if containerized_deployment %}
+  {% if containerized_deployment | bool %}
   osd_id=$(echo ${unit#ceph-osd@} | grep -oE '[0-9]+')
   container_id=$(get_container_id_from_dev_name "ceph-osd-${osd_id}")
   container_exec="{{ container_binary }} exec $container_id"
index 5fb23454a861488caa0d0ffd3552259d38fb401f..1bdf1d7cffd9e0a53c7a5735dda12d258f791ff8 100644 (file)
@@ -3,7 +3,7 @@
 RETRIES="{{ handler_health_rbd_mirror_check_retries }}"
 DELAY="{{ handler_health_rbd_mirror_check_delay }}"
 RBD_MIRROR_NAME="{{ ansible_hostname }}"
-{% if containerized_deployment %}
+{% if containerized_deployment | bool %}
 DOCKER_EXEC="{{ container_binary }} exec ceph-rbd-mirror-{{ ansible_hostname }}"
 {% endif %}
 
index becd37638ca1ef1d26e99fedaa136781020a72de..cd876fb60811da7d4acdb1dfcc8d41be00ffe6c7 100644 (file)
@@ -14,8 +14,8 @@
   copy:
     dest: "{{ item.item.path }}"
     content: "{{ item.stdout + '\n' }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   with_items: "{{ _iscsi_keys.results }}"
   when:
@@ -60,5 +60,5 @@
     size: "{{ iscsi_pool_size | default(osd_pool_default_size) }}"
     application: "rbd"
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
\ No newline at end of file
index 1d5364a703dfa567584e3aaccaf1f813535119f9..0c7ad58802ed7db2b226ab40c9dee65cf573c98c 100644 (file)
@@ -3,8 +3,8 @@
   file:
     path: "{{ item }}"
     state: directory
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_directories_mode }}"
   with_items:
     - /var/lib/ceph/bootstrap-mds/
@@ -26,8 +26,8 @@
   copy:
     dest: "{{ item.item.path }}"
     content: "{{ item.stdout + '\n' }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   with_items: "{{ _mds_keys.results }}"
   when:
index 15c201a51cf3ac8de9be2af70cbddfbb28417636..93ec880d45f49c0a09f20ff4a1d55130fb97ef59 100644 (file)
@@ -19,7 +19,7 @@
   with_items: "{{ cephfs_pools }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
 
 - name: check and create ceph filesystem
@@ -42,4 +42,4 @@
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when:
     - mds_max_mds > 1
-    - not rolling_update
+    - not rolling_update | bool
index a3bef65abd8dab3c3e5d4173c3bce753089e9b56..fe683f4124a51ed932319339dff0be36d965f041 100644 (file)
@@ -3,7 +3,7 @@
   apt:
     name: ceph-mds
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
-    default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else '' }}"
+    default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else '' }}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
   when:
     - mds_group_name in group_names
     - ansible_os_family == 'Debian'
@@ -25,7 +25,7 @@
   args:
     creates: /var/lib/ceph/mds/{{ cluster }}-{{ ansible_hostname }}/keyring
   changed_when: false
-  when: cephx
+  when: cephx | bool
 
 - name: set mds key permissions
   file:
@@ -33,7 +33,7 @@
     owner: "ceph"
     group: "ceph"
     mode: "0600"
-  when: cephx
+  when: cephx | bool
 
 - name: ensure systemd service override directory exists
   file:
index 8f94c8b9cfdf181f0376c2d3d6e551fa5a83fd45..79bcd43e68b5e25a624332abc6941d4009532169 100644 (file)
@@ -3,8 +3,8 @@
   file:
     path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}
     state: directory
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_directories_mode }}"
 
 - name: fetch ceph mgr keyring
       mds: allow *
     cluster: "{{ cluster }}"
     secret: "{{ (mgr_secret != 'mgr_secret') | ternary(mgr_secret, omit) }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "0400"
     dest: "/var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring"
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   when: groups.get(mgr_group_name, []) | length == 0 # the key is present already since one of the mons created it in "create ceph mgr keyring(s)"
 
           mds: allow *
         cluster: "{{ cluster }}"
         secret: "{{ (mgr_secret != 'mgr_secret') | ternary(mgr_secret, omit) }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "0400"
       environment:
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       with_items: "{{ groups.get(mgr_group_name, []) }}"
       run_once: True
@@ -66,8 +66,8 @@
       copy:
         dest: "{{ item.item.path }}"
         content: "{{ item.stdout + '\n' }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
       with_items: "{{ _mgr_keys.results }}"
       when:
@@ -77,7 +77,7 @@
 - name: set mgr key permissions
   file:
     path: /var/lib/ceph/mgr/{{ cluster }}-{{ ansible_hostname }}/keyring
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   when: cephx | bool
index d5cf2ef1ef13ce1469e9ea3e58dcb9ede7ab99a8..649e34675d298aee7d8e29d7556834f235f3486f 100644 (file)
@@ -21,6 +21,6 @@
 - name: include mgr_modules.yml
   include_tasks: mgr_modules.yml
   when:
-    - ceph_mgr_modules | length > 0 or dashboard_enabled
+    - ceph_mgr_modules | length > 0 or dashboard_enabled | bool
     - ((groups[mgr_group_name] | default([]) | length == 0 and inventory_hostname == groups[mon_group_name] | last) or
       (groups[mgr_group_name] | default([]) | length > 0 and inventory_hostname == groups[mgr_group_name] | last))
index 76102e22f4c96690cb202a4188c6d460d92f9c4c..cd4740ae1468c4c8e10d928e780ef39dddf4504e 100644 (file)
@@ -30,7 +30,7 @@
   apt:
     name: '{{ ceph_mgr_packages }}'
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
-    default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else ''}}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports else '' }}"
+    default_release: "{{ ceph_stable_release_uca | default('') if ceph_origin == 'repository' and ceph_repository == 'uca' else ''}}{{ ansible_distribution_release ~ '-backports' if ceph_origin == 'distro' and ceph_use_distro_backports | bool else '' }}"
   register: result
   until: result is succeeded
   when: ansible_os_family == 'Debian'
index afcb6ecca4482d6d0b829e948eb54b9ec16af301..ee14cb3eb524412a049c72a110fabee1d1403ef2 100644 (file)
   ceph_key:
     state: fetch_initial_keys
     cluster: "{{ cluster }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "0400"
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
     CEPH_ROLLING_UPDATE: "{{ rolling_update }}"
   when:
index 4f9ee58f5951844db8e9f9be2c9521dc1c0730d8..42a07645803748de369342c6d8ab7a1c8826a518 100644 (file)
     caps:
       mon: allow *
     import_key: False
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "0400"
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
 
 - name: copy the initial key in /etc/ceph (for containers)
@@ -53,8 +53,8 @@
   file:
     path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}
     state: directory
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_directories_mode }}"
     recurse: true
 
     caps: "{{ client_admin_ceph_authtool_cap }}"
     import_key: False
     cluster: "{{ cluster }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "0400"
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
   register: create_custom_admin_secret
   when:
@@ -78,7 +78,7 @@
 
 - name: set_fact ceph-authtool container command
   set_fact:
-    ceph_authtool_cmd: "{{ container_binary + ' run --net=host --rm -v /var/lib/ceph:/var/lib/ceph:z -v /etc/ceph/:/etc/ceph/:z --entrypoint=ceph-authtool ' + ceph_client_docker_registry + '/' + ceph_client_docker_image + ':' + ceph_client_docker_image_tag if containerized_deployment else 'ceph-authtool' }}"
+    ceph_authtool_cmd: "{{ container_binary + ' run --net=host --rm -v /var/lib/ceph:/var/lib/ceph:z -v /etc/ceph/:/etc/ceph/:z --entrypoint=ceph-authtool ' + ceph_client_docker_registry + '/' + ceph_client_docker_image + ':' + ceph_client_docker_image_tag if containerized_deployment | bool else 'ceph-authtool' }}"
 
 - name: import admin keyring into mon keyring
   command: >
 
 - name: set_fact ceph-mon container command
   set_fact:
-    ceph_mon_cmd: "{{ container_binary + ' run --rm --net=host -v /var/lib/ceph/:/var/lib/ceph:z -v /etc/ceph/:/etc/ceph/:z --entrypoint=ceph-mon ' + ceph_client_docker_registry + '/' + ceph_client_docker_image + ':' +ceph_client_docker_image_tag if containerized_deployment else 'ceph-mon' }}"
+    ceph_mon_cmd: "{{ container_binary + ' run --rm --net=host -v /var/lib/ceph/:/var/lib/ceph:z -v /etc/ceph/:/etc/ceph/:z --entrypoint=ceph-mon ' + ceph_client_docker_registry + '/' + ceph_client_docker_image + ':' +ceph_client_docker_image_tag if containerized_deployment | bool else 'ceph-mon' }}"
 
 - name: ceph monitor mkfs with keyring
   command: >
     {{ ceph_mon_cmd }}
     --cluster {{ cluster }}
-    --setuser "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    --setgroup "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    --setuser "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    --setgroup "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     --mkfs
     -i {{ monitor_name }}
     --fsid {{ fsid }}
   command: >
     {{ ceph_mon_cmd }}
     --cluster {{ cluster }}
-    --setuser "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    --setgroup "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    --setuser "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    --setgroup "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     --mkfs
     -i {{ monitor_name }}
     --fsid {{ fsid }}
index c6a4e74ea1b7aa6155ae68f050b1e7706a213e33..72fd5538fa310f1e379b03d313a35d875b66d4d2 100644 (file)
@@ -25,7 +25,7 @@
 
 - name: start the monitor service
   systemd:
-    name: ceph-mon@{{ monitor_name if not containerized_deployment else ansible_hostname }}
+    name: ceph-mon@{{ monitor_name if not containerized_deployment | bool else ansible_hostname }}
     state: started
     enabled: yes
     masked: no
index 169cca71a94680a5e3712d275480704283d08eba..1f998a29b05b7e04b9eeca4d03995699a83aa14a 100644 (file)
@@ -28,10 +28,10 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \
 {% if ansible_distribution == 'RedHat' -%}
   -v /etc/pki/ca-trust/extracted:/etc/pki/ca-trust/extracted:z \
 {% endif -%}
-{% if mon_docker_privileged -%}
+{% if mon_docker_privileged | bool -%}
   --privileged \
 {% endif -%}
-{% if mon_docker_net_host -%}
+{% if mon_docker_net_host | bool -%}
   --net=host \
 {% endif -%}
   -e IP_VERSION={{ ip_version[-1:] }} \
index 4cd3bd3e287046bc93cc58324fd4caad75fcbb84..8f336057e6dc2bb08952cf160617dc855b25bfab 100644 (file)
@@ -35,8 +35,8 @@
       file:
         path: "/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ item }}"
         state: directory
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "0755"
       with_items:
         - "{{ ceph_nfs_ceph_user }}"
@@ -51,8 +51,8 @@
         dest: "{{ item.1 }}"
         content: "{{ item.0.content | b64decode }}"
         mode: "{{ item.0.item.get('mode', '0600') }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
       with_nested:
         - "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] | default([]) }}"
         - ['/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ceph_nfs_ceph_user }}/keyring', '/var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ ansible_hostname }}/keyring']
index aaff416fceadf3a045840e2e6c920f696192a004..78a9b9ed37bc9274465c84934606730ca87a0184 100644 (file)
@@ -25,8 +25,8 @@
       copy:
         dest: "{{ item.item.path }}"
         content: "{{ item.stdout + '\n' }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
       with_items: "{{ _rgw_keys.results }}"
       when:
index 4bb4f114c6954a54d02e557f3a488f64270d3970..6c7ffada7bce215bee013324b53d9a3421af08ac 100644 (file)
@@ -63,8 +63,8 @@
       copy:
         dest: "{{ item.item.path }}"
         content: "{{ item.stdout + '\n' }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ ceph_keyring_permissions }}"
       with_items: "{{ _rgw_keys.results }}"
       when:
index 4ebf360ee907f954ae314c1219e9943309c2e416..341f3961f3b3ca6d9fcba979cf210318d0bac477 100644 (file)
@@ -46,7 +46,7 @@
         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 redhat nfs-ganesha-rgw and ceph-radosgw packages
       package:
index 603ae12b3b2ef284a711b905a90883afb3fa344b..921fb0b57f1770ccf2d7dda6bc09fc3d939f2724 100644 (file)
@@ -26,7 +26,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --net=host \
   -v /var/run/ceph:/var/run/ceph:z \
   -v /var/log/ceph:/var/log/ceph:z \
   -v /var/log/ganesha:/var/log/ganesha:z \
-  {% if ceph_nfs_dynamic_exports %}
+  {% if ceph_nfs_dynamic_exports | bool %}
   --privileged \
   -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket \
   {% endif -%}
index 9ac40126d6b831a0e60a6b49f61adf2ddd71c54f..13c8a448b08cc93adf236aff91fa8510679b3c78 100644 (file)
@@ -1,7 +1,7 @@
 #jinja2: trim_blocks: "true", lstrip_blocks: "true"
 # {{ ansible_managed }}
 
-{% if ceph_nfs_dynamic_exports and not ceph_nfs_rados_backend %}
+{% if ceph_nfs_dynamic_exports | bool and not ceph_nfs_rados_backend | bool %}
 %include /etc/ganesha/export.d/INDEX.conf
 {% endif %}
 
@@ -12,7 +12,7 @@ NFS_Core_Param
 {% endif %}
 }
 
-{% if ceph_nfs_disable_caching or nfs_file_gw %}
+{% if ceph_nfs_disable_caching | bool or nfs_file_gw | bool %}
 EXPORT_DEFAULTS {
        Attr_Expiration_Time = 0;
 }
@@ -25,7 +25,7 @@ CACHEINODE {
 }
 {% endif %}
 
-{% if ceph_nfs_rados_backend %}
+{% if ceph_nfs_rados_backend | bool %}
 RADOS_URLS {
    ceph_conf = '/etc/ceph/{{ cluster }}.conf';
    userid = "{{ ceph_nfs_ceph_user }}";
@@ -42,7 +42,7 @@ RADOS_KV {
 }
 {% endif %}
 
-{% if nfs_file_gw %}
+{% if nfs_file_gw | bool %}
 EXPORT
 {
        Export_id={{ ceph_nfs_ceph_export_id }};
@@ -71,7 +71,7 @@ EXPORT
         {{ ganesha_ceph_export_overrides | default(None) }}
 }
 {% endif %}
-{% if nfs_obj_gw %}
+{% if nfs_obj_gw | bool %}
 EXPORT
 {
        Export_id={{ ceph_nfs_rgw_export_id }};
index 576b8991a7d138945ef420aee9f2faf3ba91bb95..e1c156c4f5b8ba1664bcfbbf4f7270757fbbbc86 100644 (file)
@@ -3,8 +3,8 @@
   file:
     path: "{{ item }}"
     state: directory
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_directories_mode }}"
   when: cephx | bool
   with_items:
@@ -27,8 +27,8 @@
   copy:
     dest: "{{ item.item.path }}"
     content: "{{ item.stdout + '\n' }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   with_items: "{{ _osd_keys.results }}"
   when:
index 6f31754d2e3ffa88eaa7b31038ee5860c867de4c..fbf4408e6eefa27220ab1d42efd4320bb333ae62 100644 (file)
@@ -18,7 +18,7 @@
       with_items: "{{ openstack_pools }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       environment:
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
 
 - name: create openstack cephx key(s)
@@ -31,7 +31,7 @@
         cluster: "{{ cluster }}"
         mode: "{{ item.mode|default(omit) }}"
       environment:
-        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+        CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
         CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       with_items: "{{ openstack_keys }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
@@ -47,8 +47,8 @@
       copy:
         dest: "/etc/ceph/{{ cluster }}.{{ item.0.item.name }}.keyring"
         content: "{{ item.0.stdout + '\n' }}"
-        owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-        group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
         mode: "{{ item.0.item.mode }}"
       with_nested:
         - "{{ _osp_keys.results }}"
index 0649c654fb6999911ea95a48afa7f1406cc5d5d4..2f30f3b24560c7ffbc851ab8ed21bc75514cc87c 100644 (file)
@@ -16,7 +16,7 @@
     action: "batch"
   environment:
     CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
     PYTHONIOENCODING: utf-8
   when: _devices | default([]) | length > 0
index 3ef5967f44783cc5efcd332cc4ae8d118a41a926..217df0c457e00af7f83e63e58e99f9bae935b201 100644 (file)
     wal_vg: "{{ item.wal_vg|default(omit) }}"
     crush_device_class: "{{ item.crush_device_class|default(omit) }}"
     dmcrypt: "{{ dmcrypt|default(omit) }}"
-    action: "{{ 'prepare' if containerized_deployment else 'create' }}"
+    action: "{{ 'prepare' if containerized_deployment | bool else 'create' }}"
   environment:
     CEPH_VOLUME_DEBUG: "{{ ceph_volume_debug }}"
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
     PYTHONIOENCODING: utf-8
   with_items: "{{ lvm_volumes }}"
index b3b99f4a69ef4e072f0f0a7fa87781c3af836007..3a8c82ae1114911f06fb3f27484125f6c20ccd9b 100644 (file)
@@ -21,7 +21,7 @@
 
 - name: set_fact docker_exec_start_osd
   set_fact:
-    docker_exec_start_osd: "{{ '{{ container_binary }} run --rm --net=host --privileged=true -v /var/run/udev/:/var/run/udev/:z -v /run/lvm/:/run/lvm/ -v /etc/ceph:/etc/ceph:z -v /dev:/dev --entrypoint=ceph-volume ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph-volume' }}"
+    docker_exec_start_osd: "{{ '{{ container_binary }} run --rm --net=host --privileged=true -v /var/run/udev/:/var/run/udev/:z -v /run/lvm/:/run/lvm/ -v /etc/ceph:/etc/ceph:z -v /dev:/dev --entrypoint=ceph-volume ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else 'ceph-volume' }}"
 
 - name: collect osd ids
   command: "{{ docker_exec_start_osd }} lvm list --format json"
index e350808aef6d2dc695e1f053a5a9883d53bd49bb..e1742746994decbf8dd4658aa8a37ee36b6be3c7 100644 (file)
@@ -15,8 +15,8 @@
   copy:
     dest: "{{ item.item.path }}"
     content: "{{ item.stdout + '\n' }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   with_items: "{{ _rbd_mirror_keys.results }}"
   when:
index 5e0520c6996bff57c1a692d4a351298052bfc150..f4764294e1eef56150f7dc526a1cc0e3e2144f44 100644 (file)
@@ -3,8 +3,8 @@
   file:
     path: "{{ item }}"
     state: directory
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_directories_mode }}"
   with_items: "{{ rbd_client_admin_socket_path }}"
 
@@ -24,8 +24,8 @@
   copy:
     dest: "{{ item.item.path }}"
     content: "{{ item.stdout + '\n' }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
   with_items: "{{ _rgw_keys.results }}"
   when:
@@ -36,8 +36,8 @@
   copy:
     content: "{{ radosgw_frontend_ssl_certificate_data }}"
     dest: "{{ radosgw_frontend_ssl_certificate }}"
-    owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
-    group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
+    owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+    group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
     mode: 0440
   when: radosgw_frontend_ssl_certificate | length > 0 and radosgw_frontend_ssl_certificate_data | length > 0
   notify: restart ceph rgws
index 7a11f4766eeae89d4abaad67d535929a37f9aadd..751512b6fc1a43ab399a635c5e62a084eb00df28 100644 (file)
@@ -43,7 +43,7 @@
     - item.value.type is defined
     - item.value.type == 'ec'
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
 
 - name: create replicated pools for rgw
@@ -61,5 +61,5 @@
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when: item.value.type is not defined or item.value.type == 'replicated'
   environment:
-    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
+    CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
     CEPH_CONTAINER_BINARY: "{{ container_binary }}"
index 99895dcbb21f4b4abb1441f473807e8618ac8fc8..9f5b6ffde5e996e4a258d775c3265e68fe988022 100644 (file)
@@ -3,7 +3,7 @@
   fail:
     msg: "ceph_nfs_rgw_access_key and ceph_nfs_rgw_secret_key must be set if nfs_obj_gw is True"
   when:
-    - nfs_obj_gw
+    - nfs_obj_gw | bool
     - groups.get(mon_group_name, []) | length == 0
     - (ceph_nfs_rgw_access_key is undefined or ceph_nfs_rgw_secret_key is undefined)