]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
improve coding style
authorRishabh Dave <ridave@redhat.com>
Mon, 1 Apr 2019 15:46:15 +0000 (21:16 +0530)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 23 Apr 2019 13:37:07 +0000 (15:37 +0200)
Keywords requiring only one item shouldn't express it by creating a
list with single item.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
111 files changed:
infrastructure-playbooks/add-osd.yml
infrastructure-playbooks/lv-create.yml
infrastructure-playbooks/lv-teardown.yml
infrastructure-playbooks/purge-cluster.yml
infrastructure-playbooks/purge-docker-cluster.yml
infrastructure-playbooks/rolling_update.yml
infrastructure-playbooks/shrink-mon.yml
infrastructure-playbooks/shrink-osd.yml
infrastructure-playbooks/storage-inventory.yml
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml
infrastructure-playbooks/untested-by-ci/cluster-os-migration.yml
infrastructure-playbooks/untested-by-ci/make-osd-partitions.yml
infrastructure-playbooks/untested-by-ci/migrate-journal-to-ssd.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
raw_install_python.yml
roles/ceph-agent/tasks/pre_requisite.yml
roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-client/tasks/main.yml
roles/ceph-common/tasks/configure_cluster_name.yml
roles/ceph-common/tasks/configure_memory_allocator.yml
roles/ceph-common/tasks/create_rbd_client_dir.yml
roles/ceph-common/tasks/installs/configure_debian_repository_installation.yml
roles/ceph-common/tasks/installs/configure_redhat_local_installation.yml
roles/ceph-common/tasks/installs/configure_redhat_repository_installation.yml
roles/ceph-common/tasks/installs/configure_suse_repository_installation.yml
roles/ceph-common/tasks/installs/debian_rhcs_repository.yml
roles/ceph-common/tasks/installs/install_on_debian.yml
roles/ceph-common/tasks/installs/install_on_redhat.yml
roles/ceph-common/tasks/installs/install_on_suse.yml
roles/ceph-common/tasks/installs/install_redhat_packages.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_cdn_install.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install.yml
roles/ceph-common/tasks/installs/prerequisite_rhcs_iso_install_debian.yml
roles/ceph-common/tasks/installs/redhat_community_repository.yml
roles/ceph-common/tasks/installs/redhat_rhcs_repository.yml
roles/ceph-common/tasks/main.yml
roles/ceph-common/tasks/release-rhcs.yml
roles/ceph-config/tasks/main.yml
roles/ceph-container-common/tasks/fetch_image.yml
roles/ceph-container-common/tasks/main.yml
roles/ceph-container-common/tasks/pre_requisites/prerequisites.yml
roles/ceph-container-common/tasks/release.yml
roles/ceph-facts/tasks/facts.yml
roles/ceph-facts/tasks/set_monitor_address.yml
roles/ceph-facts/tasks/set_radosgw_address.yml
roles/ceph-handler/handlers/main.yml
roles/ceph-handler/tasks/check_running_cluster.yml
roles/ceph-handler/tasks/check_running_containers.yml
roles/ceph-handler/tasks/check_socket_non_container.yml
roles/ceph-infra/tasks/configure_firewall.yml
roles/ceph-infra/tasks/setup_ntp.yml
roles/ceph-iscsi-gw/tasks/common.yml
roles/ceph-iscsi-gw/tasks/container/containerized.yml
roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml
roles/ceph-iscsi-gw/tasks/main.yml
roles/ceph-iscsi-gw/tasks/non-container/prerequisites.yml
roles/ceph-mds/tasks/containerized.yml
roles/ceph-mds/tasks/create_mds_filesystems.yml
roles/ceph-mds/tasks/main.yml
roles/ceph-mgr/tasks/common.yml
roles/ceph-mgr/tasks/main.yml
roles/ceph-mgr/tasks/mgr_modules.yml
roles/ceph-mgr/tasks/pre_requisite.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/create_rgw_nfs_user.yml
roles/ceph-nfs/tasks/ganesha_selinux_fix.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/pre_requisite_non_container_red_hat.yml
roles/ceph-nfs/tasks/start_nfs.yml
roles/ceph-osd/tasks/common.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/docker/start_docker_rbd_mirror.yml
roles/ceph-rbd-mirror/tasks/main.yml
roles/ceph-rbd-mirror/tasks/pre_requisite.yml
roles/ceph-rgw/tasks/common.yml
roles/ceph-rgw/tasks/docker/start_docker_rgw.yml
roles/ceph-rgw/tasks/main.yml
roles/ceph-rgw/tasks/multisite/destroy.yml
roles/ceph-rgw/tasks/multisite/main.yml
roles/ceph-rgw/tasks/multisite/master.yml
roles/ceph-rgw/tasks/multisite/secondary.yml
roles/ceph-rgw/tasks/openstack-keystone.yml
roles/ceph-rgw/tasks/pre_requisite.yml
roles/ceph-rgw/tasks/start_radosgw.yml
roles/ceph-validate/tasks/check_devices.yml
roles/ceph-validate/tasks/check_eth_mon.yml
roles/ceph-validate/tasks/check_eth_rgw.yml
roles/ceph-validate/tasks/check_ipaddr_mon.yml
roles/ceph-validate/tasks/check_system.yml
roles/ceph-validate/tasks/main.yml
site-container.yml.sample
site.yml.sample
tests/functional/dev_setup.yml
tests/functional/lvm_setup.yml
tests/functional/rgw_multisite.yml
tests/functional/rhcs_setup.yml
tests/functional/setup.yml

index 31861930cd2c62c0791e92368484c010ac939365..90f9be6f2bbe045710ac1461af94d3bf69ea954e 100644 (file)
@@ -28,8 +28,7 @@
   pre_tasks:
     - name: gather facts
       setup:
-      when:
-        - not delegate_facts_host | bool
+      when: not delegate_facts_host | bool
 
     - import_role:
         name: ceph-defaults
@@ -42,8 +41,7 @@
         - "{{ groups[mon_group_name] }}"
         - "{{ groups[osd_group_name] }}"
       run_once: True
-      when:
-        - delegate_facts_host | bool
+      when: delegate_facts_host | bool
 
   tasks:
     - import_role:
@@ -63,8 +61,7 @@
 
     - name: gather facts
       setup:
-      when:
-        - not delegate_facts_host | bool
+      when: not delegate_facts_host | bool
 
     - import_role:
         name: ceph-defaults
@@ -77,8 +74,7 @@
         - "{{ groups[mon_group_name] }}"
         - "{{ groups[osd_group_name] }}"
       run_once: True
-      when:
-        - delegate_facts_host | bool
+      when: delegate_facts_host | bool
 
     # this task is needed so we can skip the openstack_config.yml include in roles/ceph-osd
     - name: set_fact add_osd
index ec3c72b87ea8bd9bb81ce3efa5d71247668e944f..8a3858e705979f6c53b9ff6336d38efad8c8a60d 100644 (file)
@@ -1,7 +1,6 @@
 - name: creates logical volumes for the bucket index or fs journals on a single device. 
   become: true
-  hosts:
-  - osds
+  hosts: osds
 
   vars:
     logfile: |
       vg: "{{ nvme_vg_name }}"
       size: "{{ journal_size }}"
       pvs: "{{ nvme_device }}"
-    with_items:
-      - "{{ nvme_device_lvs }}"
+    with_items: "{{ nvme_device_lvs }}"
 
   - name: create lvs for fs journals for hdd devices
     lvol:
       lv: "{{ hdd_journal_prefix }}-{{ item.split('/')[-1] }}"
       vg: "{{ nvme_vg_name }}"
       size: "{{ journal_size }}"
-    with_items:
-      - "{{ hdd_devices }}"
+    with_items: "{{ hdd_devices }}"
 
   - name: create the lv for data portion of the bucket index on the nvme device
     lvol:
@@ -73,8 +70,7 @@
       vg: "{{ nvme_vg_name }}"
       size: "{{ item.size }}"
       pvs: "{{ nvme_device }}"
-    with_items:
-      - "{{ nvme_device_lvs }}"
+    with_items: "{{ nvme_device_lvs }}"
 
     # Make sure all hdd devices have a unique volume group
   - name: create vgs for all hdd devices
@@ -84,8 +80,7 @@
       pesize: 4
       state: present
       vg: "{{ hdd_vg_prefix }}-{{ item.split('/')[-1] }}"
-    with_items:
-      - "{{ hdd_devices }}"
+    with_items: "{{ hdd_devices }}"
 
   - name: create lvs for the data portion on hdd devices
     lvol:
@@ -93,8 +88,7 @@
       vg: "{{ hdd_vg_prefix }}-{{ item.split('/')[-1] }}"
       size: "{{ hdd_lv_size }}"
       pvs: "{{ item }}"
-    with_items:
-      - "{{ hdd_devices }}"
+    with_items: "{{ hdd_devices }}"
 
   - name: "write output for osds.yml to {{ logfile_path }}"
     become: false
index a717f9f7ecf53e1dad897768d950d87c958e4b2a..cab24250a274e9d9edcb4d5e76a0a2f286c35f2e 100644 (file)
@@ -1,7 +1,6 @@
 - name: tear down existing osd filesystems then logical volumes, volume groups, and physical volumes
   become: true
-  hosts:
-  - osds
+  hosts: osds
 
   vars_prompt:
     - name: ireallymeanit
@@ -52,8 +51,7 @@
       vg: "{{ nvme_vg_name }}"
       state: absent
       force: yes
-    with_items:
-      - "{{ nvme_device_lvs }}"
+    with_items: "{{ nvme_device_lvs }}"
 
   - name: tear down any existing hdd data lvs 
     lvol:
@@ -61,8 +59,7 @@
       vg: "{{ hdd_vg_prefix }}-{{ item.split('/')[-1] }}"
       state: absent
       force: yes
-    with_items:
-      - "{{ hdd_devices }}"
+    with_items: "{{ hdd_devices }}"
 
   - name: tear down any existing lv of journal for bucket index
     lvol:
@@ -70,8 +67,7 @@
       vg: "{{ nvme_vg_name }}"
       state: absent
       force: yes
-    with_items:
-      - "{{ nvme_device_lvs }}"
+    with_items: "{{ nvme_device_lvs }}"
 
   - name: tear down any existing lvs of hdd journals
     lvol:
@@ -79,8 +75,7 @@
       vg: "{{ nvme_vg_name }}"
       state: absent
       force: yes
-    with_items:
-      - "{{ hdd_devices }}"
+    with_items: "{{ hdd_devices }}"
 
   ## Volume Groups
   - name: remove vg on nvme device
@@ -94,8 +89,7 @@
       vg: "{{ hdd_vg_prefix }}-{{ item.split('/')[-1] }}"
       state: absent
       force: yes
-    with_items:
-      - "{{ hdd_devices }}"
+    with_items: "{{ hdd_devices }}"
 
   ## Physical Vols
   - name: tear down pv for nvme device
 
   - name: tear down pv for each hdd device
     command: "pvremove --force --yes {{ item }}"
-    with_items:
-      - "{{ hdd_devices }}"
+    with_items: "{{ hdd_devices }}"
index 093c70e417e9b6a2d7266ab5e004a804aa8cebce..66700cf06972dde9cab161fce6cfc790c7bac031 100644 (file)
@@ -53,8 +53,7 @@
   vars:
     mds_group_name: mdss
 
-  hosts:
-    - "{{ mds_group_name|default('mdss') }}"
+  hosts: "{{ mds_group_name|default('mdss') }}"
 
   gather_facts: false # Already gathered previously
 
@@ -75,8 +74,7 @@
   vars:
     mgr_group_name: mgrs
 
-  hosts:
-    - "{{ mgr_group_name|default('mgrs') }}"
+  hosts: "{{ mgr_group_name|default('mgrs') }}"
 
   gather_facts: false # Already gathered previously
 
@@ -98,8 +96,7 @@
   vars:
     rgw_group_name: rgws
 
-  hosts:
-    - "{{ rgw_group_name|default('rgws') }}"
+  hosts: "{{ rgw_group_name|default('rgws') }}"
 
   gather_facts: false # Already gathered previously
 
   vars:
     rbdmirror_group_name: rbdmirrors
 
-  hosts:
-    - "{{ rbdmirror_group_name|default('rbdmirrors') }}"
+  hosts: "{{ rbdmirror_group_name|default('rbdmirrors') }}"
 
   gather_facts: false # Already gathered previously
 
   vars:
     nfs_group_name: nfss
 
-  hosts:
-    - "{{ nfs_group_name|default('nfss') }}"
+  hosts: "{{ nfs_group_name|default('nfss') }}"
 
   gather_facts: false # Already gathered previously
 
     osd_group_name: osds
     reboot_osd_node: False
 
-  hosts:
-    - "{{ osd_group_name|default('osds') }}"
+  hosts: "{{ osd_group_name|default('osds') }}"
 
   gather_facts: false # Already gathered previously
 
   - name: resolve parent device
     command: lsblk --nodeps -no pkname "{{ item }}"
     register: tmp_resolved_parent_device
-    with_items:
-      - "{{ combined_devices_list }}"
+    with_items: "{{ combined_devices_list }}"
 
   - name: set_fact resolved_parent_device
     set_fact:
       parted -s /dev/"{{ item }}" mklabel gpt
       partprobe /dev/"{{ item }}"
       udevadm settle --timeout=600
-    with_items:
-      - "{{ resolved_parent_device }}"
+    with_items: "{{ resolved_parent_device }}"
 
 - name: purge ceph mon cluster
 
   vars:
     mon_group_name:       mons
 
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
 
   gather_facts: false # already gathered previously
 
       module: command
         echo requesting data removal
     become: false
-    notify:
-      - remove data
+    notify: remove data
 
   - name: purge dnf cache
     command: dnf clean all
     file:
       path: "{{ item.path }}"
       state: absent
-    with_items:
-      - "{{ systemd_files.files }}"
+    with_items: "{{ systemd_files.files }}"
     when: ansible_service_mgr == 'systemd'
 
 
 - name: purge fetch directory
 
-  hosts:
-    - localhost
+  hosts: localhost
 
   gather_facts: false
 
index 74fdc1090cb360a550dc11bcda3eb67d2fa1d83f..08ca24573ac83b4200036381e275700da21676fc 100644 (file)
@@ -4,8 +4,7 @@
 
 - name: confirm whether user really meant to purge the cluster
 
-  hosts:
-    - localhost
+  hosts: localhost
 
   gather_facts: false
 
@@ -36,8 +35,7 @@
 
 - name: purge ceph mds cluster
 
-  hosts:
-    - "{{ mds_group_name|default('mdss') }}"
+  hosts: "{{ mds_group_name|default('mdss') }}"
 
   become: true
 
@@ -69,8 +67,7 @@
       name: "{{ ceph_docker_image }}"
       tag: "{{ ceph_docker_image_tag }}"
       force: yes
-    tags:
-      remove_img
+    tags: remove_img
     ignore_errors: true
 
 - name: purge ceph iscsigws cluster
       name: "{{ ceph_docker_image }}"
       tag: "{{ ceph_docker_image_tag }}"
       force: yes
-    tags:
-      remove_img
+    tags: remove_img
     ignore_errors: true
 
 - name: purge ceph mgr cluster
 
-  hosts:
-    - "{{ mgr_group_name|default('mgrs') }}"
+  hosts: "{{ mgr_group_name|default('mgrs') }}"
   become: true
   tasks:
 
       name: "{{ ceph_docker_image }}"
       tag: "{{ ceph_docker_image_tag }}"
       force: yes
-    tags:
-      remove_img
+    tags: remove_img
     ignore_errors: true
 
 - name: purge ceph rgw cluster
 
-  hosts:
-    - "{{ rgw_group_name|default('rgws') }}"
+  hosts: "{{ rgw_group_name|default('rgws') }}"
 
   become: true
 
 
 - name: purge ceph rbd-mirror cluster
 
-  hosts:
-    - "{{ rbdmirror_group_name|default('rbdmirrors') }}"
+  hosts: "{{ rbdmirror_group_name|default('rbdmirrors') }}"
 
   become: true
 
       name: "{{ ceph_docker_image }}"
       tag: "{{ ceph_docker_image_tag }}"
       force: yes
-    tags:
-      remove_img
+    tags: remove_img
 
 
 - name: purge ceph nfs cluster
 
-  hosts:
-    - "{{ nfs_group_name|default('nfss') }}"
+  hosts: "{{ nfs_group_name|default('nfss') }}"
 
   become: true
 
       name: "{{ ceph_docker_image }}"
       tag: "{{ ceph_docker_image_tag }}"
       force: yes
-    tags:
-      remove_img
+    tags: remove_img
 
 
 - name: purge ceph osd cluster
 
-  hosts:
-    - "{{ osd_group_name | default('osds') }}"
+  hosts: "{{ osd_group_name | default('osds') }}"
 
   gather_facts: true
   become: true
       name: "{{ ceph_docker_image }}"
       tag: "{{ ceph_docker_image_tag }}"
       force: yes
-    tags:
-      remove_img
+    tags: remove_img
     ignore_errors: true
 
   - name: include vars from group_vars/osds.yml
     file:
       path: "{{ item.path }}"
       state: absent
-    with_items:
-      - "{{ osd_disk_prepare_logs.files }}"
+    with_items: "{{ osd_disk_prepare_logs.files }}"
 
 - name: purge ceph mon cluster
 
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
 
   become: true
 
       name: "{{ ceph_docker_image }}"
       tag: "{{ ceph_docker_image_tag }}"
       force: yes
-    tags:
-      remove_img
+    tags: remove_img
     ignore_errors: true
 
 - name: check container hosts
 
   become: true
 
-  tags:
-    with_pkg
+  tags: with_pkg
 
   tasks:
   - name: check if it is Atomic host
 
 - name: purge fetch directory
 
-  hosts:
-    - localhost
+  hosts: localhost
 
   gather_facts: false
 
index e4d1e23660db053ab00aafeebc433fe5f3ffd6fd..53faedfb86241be6bab647a247d838718f034852 100644 (file)
@@ -59,8 +59,7 @@
 
     - name: gather facts
       setup:
-      when:
-        - not delegate_facts_host | bool
+      when: not delegate_facts_host | bool
 
     - name: gather and delegate facts
       setup:
@@ -68,8 +67,7 @@
       delegate_facts: True
       with_items: "{{ groups['all'] }}"
       run_once: true
-      when:
-        - delegate_facts_host | bool
+      when: delegate_facts_host | bool
 
     - set_fact: rolling_update=true
 
@@ -78,8 +76,7 @@
     health_mon_check_retries: 5
     health_mon_check_delay: 15
     upgrade_ceph_packages: True
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
   serial: 1
   become: True
   tasks:
@@ -87,8 +84,7 @@
       file:
         path: /etc/profile.d/ceph-aliases.sh
         state: absent
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - name: set mon_host_count
       set_fact:
@@ -97,8 +93,7 @@
     - name: fail when less than three monitors
       fail:
         msg: "Upgrade of cluster with less than three monitors is not supported."
-      when:
-        - mon_host_count | int < 3
+      when: mon_host_count | int < 3
 
     - name: select a running monitor
       set_fact:
         enabled: no
         masked: yes
       ignore_errors: True
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     # 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
 
     # only mask the service for mgr because it must be upgraded
     # after ALL monitors, even when collocated
       systemd:
         name: ceph-mgr@{{ ansible_hostname }}
         masked: yes
-      when:
-        - inventory_hostname in groups[mgr_group_name] | default([])
-          or groups[mgr_group_name] | default([]) | length == 0
+      when: inventory_hostname in groups[mgr_group_name] | default([])
+            or groups[mgr_group_name] | default([]) | length == 0
 
     - name: set osd flags
       command: ceph --cluster {{ cluster }} osd set {{ item }}
         name: ceph-mon@{{ monitor_name }}
         state: started
         enabled: yes
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - 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
 
     - name: restart containerized ceph mon
       systemd:
         state: restarted
         enabled: yes
         daemon_reload: yes
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - 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
 
     - 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
 
 - name: upgrade ceph mgr nodes when implicitly collocated on monitors
   vars:
     health_mon_check_retries: 5
     health_mon_check_delay: 15
     upgrade_ceph_packages: True
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
   serial: 1
   become: True
   tasks:
     - name: upgrade mgrs when no mgr group explicitly defined in inventory
-      when:
-        - groups.get(mgr_group_name, []) | length == 0
+      when: groups.get(mgr_group_name, []) | length == 0
       block:
         - name: stop ceph mgr
           systemd:
   vars:
     upgrade_ceph_packages: True
     ceph_release: "{{ ceph_stable_release }}"
-  hosts:
-    - "{{ mgr_group_name|default('mgrs') }}"
+  hosts: "{{ mgr_group_name|default('mgrs') }}"
   serial: 1
   become: True
   tasks:
     health_osd_check_delay: 30
     upgrade_ceph_packages: True
 
-  hosts:
-    - "{{ osd_group_name|default('osds') }}"
+  hosts: "{{ osd_group_name|default('osds') }}"
   serial: 1
   become: True
   tasks:
         enabled: no
         masked: yes
       with_items: "{{ osd_ids.stdout_lines }}"
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - name: set num_osds for non container
       set_fact:
         enabled: yes
         masked: no
       with_items: "{{ osd_ids.stdout_lines }}"
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - name: restart containerized ceph osd
       systemd:
         masked: no
         daemon_reload: yes
       with_items: "{{ osd_names.stdout_lines }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - name: scan ceph-disk osds with ceph-volume if deploying nautilus
       command: "ceph-volume --cluster={{ cluster }} simple scan"
     - name: set_fact docker_exec_cmd_osd
       set_fact:
         docker_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - name: get osd versions
       command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       retries: "{{ health_osd_check_retries }}"
       delay: "{{ health_osd_check_delay }}"
-      when:
-        - (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0
+      when: (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0
 
 
 - name: unset osd flags
 
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
 
   become: True
 
     - name: set_fact docker_exec_cmd_osd
       set_fact:
         docker_exec_cmd_update_osd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - name: unset osd flags
       command: "{{ docker_exec_cmd_update_osd|default('') }} ceph osd unset {{ item }} --cluster {{ cluster }}"
 - name: upgrade ceph mdss cluster
   vars:
     upgrade_ceph_packages: True
-  hosts:
-    - "{{ mds_group_name|default('mdss') }}"
+  hosts: "{{ mds_group_name|default('mdss') }}"
   serial: 1
   become: True
   tasks:
         state: stopped
         enabled: no
         masked: yes
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - import_role:
         name: ceph-defaults
         state: started
         enabled: yes
         masked: no
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - name: restart ceph mds
       systemd:
         enabled: yes
         masked: no
         daemon_reload: yes
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
 
 - name: upgrade ceph rgws cluster
   vars:
     upgrade_ceph_packages: True
-  hosts:
-    - "{{ rgw_group_name|default('rgws') }}"
+  hosts: "{{ rgw_group_name|default('rgws') }}"
   serial: 1
   become: True
   tasks:
         enabled: no
         masked: yes
       with_items: "{{ rgw_instances }}"
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - import_role:
         name: ceph-handler
         masked: no
         daemon_reload: yes
       with_items: "{{ rgw_instances }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
 
 - name: upgrade ceph rbd mirror node
   vars:
     upgrade_ceph_packages: True
-  hosts:
-    - "{{ rbd_mirror_group_name|default('rbdmirrors') }}"
+  hosts: "{{ rbd_mirror_group_name|default('rbdmirrors') }}"
   serial: 1
   become: True
   tasks:
         state: started
         enabled: yes
         masked: no
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - name: restart containerized ceph rbd mirror
       systemd:
         enabled: yes
         masked: no
         daemon_reload: yes
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
 
 - name: upgrade ceph nfs node
   vars:
     upgrade_ceph_packages: True
-  hosts:
-    - "{{ nfs_group_name|default('nfss') }}"
+  hosts: "{{ nfs_group_name|default('nfss') }}"
   serial: 1
   become: True
   tasks:
         enabled: no
         masked: yes
       failed_when: false
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - import_role:
         name: ceph-defaults
         enabled: no
         masked: yes
       failed_when: false
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - import_role:
         name: ceph-defaults
         state: started
         enabled: yes
         masked: no
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
 
 - name: upgrade ceph client node
   vars:
     upgrade_ceph_packages: True
-  hosts:
-    - "{{ client_group_name|default('clients') }}"
+  hosts: "{{ client_group_name|default('clients') }}"
   serial: "{{ client_update_batch | default(20) }}"
   become: True
   tasks:
         name: ceph-client
 
 - name: complete upgrade
-  hosts:
-    - all
+  hosts: all
   become: True
   tasks:
     - import_role:
 
 
 - name: show ceph status
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
   become: True
   tasks:
     - import_role:
     - name: set_fact docker_exec_cmd_status
       set_fact:
         docker_exec_cmd_status: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - name: show ceph status
       command: "{{ docker_exec_cmd_status|default('') }} ceph --cluster {{ cluster }} -s"
index 88634525e4180ef7dfc75c7eb580d0e2dc64e6c4..8f3d5a86c16b0ff9285cae995c5ebe3751354e03 100644 (file)
@@ -14,8 +14,7 @@
 
 - name: gather facts and check the init system
 
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
 
   become: true
 
@@ -23,8 +22,7 @@
     - debug: msg="gather facts on all Ceph hosts for following reference"
 
 - name: confirm whether user really meant to remove monitor from the ceph cluster
-  hosts:
-    - localhost
+  hosts: localhost
   become: true
   vars_prompt:
     - name: ireallymeanit
@@ -40,8 +38,7 @@
       fail:
         msg: "You are about to shrink the only monitor present in the cluster.
               If you really want to do that, please use the purge-cluster playbook."
-      when:
-        - groups[mon_group_name] | length | int == 1
+      when: groups[mon_group_name] | length | int == 1
 
     - name: exit playbook, if no monitor was given
       fail:
           Exiting shrink-cluster playbook, no monitor was removed.
            On the command line when invoking the playbook, you can use
            -e mon_to_kill=ceph-mon01 argument. You can only remove a single monitor each time the playbook runs."
-      when:
-        - mon_to_kill is not defined
+      when: mon_to_kill is not defined
 
     - name: exit playbook, if the monitor is not part of the inventory
       fail:
         msg: "It seems that the host given is not part of your inventory, please make sure it is."
-      when:
-        - mon_to_kill not in groups[mon_group_name]
+      when: mon_to_kill not in groups[mon_group_name]
 
     - name: exit playbook, if user did not mean to shrink cluster
       fail:
@@ -64,8 +59,7 @@
            To shrink the cluster, either say 'yes' on the prompt or
            or use `-e ireallymeanit=yes` on the command line when
            invoking the playbook"
-      when:
-        - ireallymeanit != 'yes'
+      when: ireallymeanit != 'yes'
 
     - import_role:
         name: ceph-defaults
@@ -78,8 +72,7 @@
       set_fact:
         mon_host: "{{ item }}"
       with_items: "{{ groups[mon_group_name] }}"
-      when:
-        - item != mon_to_kill
+      when: item != mon_to_kill
 
     - name: "set_fact docker_exec_cmd build {{ container_binary }} exec command (containerized)"
       set_fact:
           msg: "The monitor has been successfully removed from the cluster.
           Please remove the monitor entry from the rest of your ceph configuration files, cluster wide."
       run_once: true
-      when:
-        - mon_to_kill_hostname not in result.stdout
+      when: mon_to_kill_hostname not in result.stdout
 
     - name: fail if monitor is still part of the cluster
       fail:
           msg: "Monitor appears to still be part of the cluster, please check what happened."
       run_once: true
-      when:
-        - mon_to_kill_hostname in result.stdout
+      when: mon_to_kill_hostname in result.stdout
 
     - name: show ceph health
       command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} -s"
index 2402fb8cc2bf8ade7e5db3200c0915669251c48a..3ff5cc2356f209dd4cdad3a84f2766ec909343f0 100644 (file)
@@ -23,8 +23,7 @@
 
 - name: confirm whether user really meant to remove osd(s) from the cluster
 
-  hosts:
-    - localhost
+  hosts: localhost
 
   become: true
 
index f4cb3fed5fd5e47c95155f0cceb3ce74029d5241..2284587ed55057ae1816fb61654fbca8f7d31446 100644 (file)
@@ -7,8 +7,7 @@
 
 - name: gather facts and check the init system
 
-  hosts:
-    - "{{ osd_group_name|default('osds') }}"
+  hosts: "{{ osd_group_name|default('osds') }}"
 
   become: true
 
@@ -17,8 +16,7 @@
 
 - name: query each host for storage device inventory
 
-  hosts:
-    - "{{ osd_group_name|default('osds') }}"
+  hosts: "{{ osd_group_name|default('osds') }}"
 
   become: true
 
index 05dcf0a1576d22e10e51e196c6b281631a6172ee..786c81448b5dc3a34863c8ea476092c0ff428f9f 100644 (file)
@@ -3,8 +3,7 @@
 
 - name: confirm whether user really meant to switch from non-containerized to containerized ceph daemons
 
-  hosts:
-    - localhost
+  hosts: localhost
 
   gather_facts: false
 
@@ -53,8 +52,7 @@
     containerized_deployment: true
     switch_to_containers: True
     mon_group_name:       mons
-  hosts:
-    - "{{ mon_group_name|default('mons') }}"
+  hosts: "{{ mon_group_name|default('mons') }}"
   serial: 1
   become: true
   pre_tasks:
 
 - name: switching from non-containerized to containerized ceph mgr
 
-  hosts:
-    - "{{ mgr_group_name|default('mgrs') }}"
+  hosts: "{{ mgr_group_name|default('mgrs') }}"
 
   vars:
     containerized_deployment: true
     containerized_deployment: true
     osd_group_name: osds
 
-  hosts:
-    - "{{ osd_group_name|default('osds') }}"
+  hosts: "{{ osd_group_name|default('osds') }}"
 
   serial: 1
   become: true
       shell: rename -v .ldb .sst /var/lib/ceph/osd/*/current/omap/*.ldb
       changed_when: false
       failed_when: false
-      when:
-        - ldb_files.rc == 0
+      when: ldb_files.rc == 0
 
     - name: check if containerized osds are already running
       command: >
         umount /var/lib/ceph/osd/{{ item }}
       changed_when: false
       failed_when: false
-      with_items:
-        - "{{ osd_dirs.stdout_lines }}"
-      when:
-        - osd_running.rc != 0
+      with_items: "{{ osd_dirs.stdout_lines }}"
+      when: osd_running.rc != 0
 
   tasks:
     - import_role:
       delegate_to: "{{ groups[mon_group_name][0] }}"
       retries: "{{ health_osd_check_retries }}"
       delay: "{{ health_osd_check_delay }}"
-      when:
-        - (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0
+      when: (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0
 
 
 - name: switching from non-containerized to containerized ceph mds
 
-  hosts:
-    - "{{ mds_group_name|default('mdss') }}"
+  hosts: "{{ mds_group_name|default('mdss') }}"
 
   vars:
     containerized_deployment: true
 
 - name: switching from non-containerized to containerized ceph rgw
 
-  hosts:
-    - "{{ rgw_group_name|default('rgws') }}"
+  hosts: "{{ rgw_group_name|default('rgws') }}"
 
   vars:
     containerized_deployment: true
 
 - name: switching from non-containerized to containerized ceph rbd-mirror
 
-  hosts:
-    - "{{ rbdmirror_group_name|default('rbdmirrors') }}"
+  hosts: "{{ rbdmirror_group_name|default('rbdmirrors') }}"
 
   vars:
     containerized_deployment: true
 
 - name: switching from non-containerized to containerized ceph nfs
 
-  hosts:
-    - "{{ nfs_group_name|default('nfss') }}"
+  hosts: "{{ nfs_group_name|default('nfss') }}"
 
   vars:
     containerized_deployment: true
index 6ff8702dd640c60982d5960d57b379cb1d094c62..ab92b7351bd401ccd638b68b1ad5904d95a4573f 100644 (file)
       service: >
         name={{ item }}
         state=stopped
-      with_items:
-        - radosgw
+      with_items: radosgw
       when: migration_completed.stat.exists == False
 
     - name: Wait for radosgw to be down
       shell: >
         {{ item }}
         chdir=/var/lib/ceph/
-      with_items:
-        - cp etc/ceph/* /etc/ceph/
+      with_items: cp etc/ceph/* /etc/ceph/
       when: migration_completed.stat.exists == False
 
     - name: Start rados gateway
       service: >
         name={{ item }}
         state=started
-      with_items:
-        - radosgw
+      with_items: radosgw
       when: migration_completed.stat.exists == False
 
     - name: Wait for radosgw to be up again
index eb7f9f8788c3eb8dee6451c0d1993d46b605fae7..c6aadfe18e461c0663c1f6209e53bb4a0c54245a 100644 (file)
@@ -27,8 +27,7 @@
     journal_typecode: 45b0969e-9b03-4f30-b4c6-b4b80ceff106
     data_typecode: 4fbd7e29-9d25-41b8-afd0-062c0ceff05d
     devices: []
-  hosts:
-  - "{{ osd_group_name }}"
+  hosts: "{{ osd_group_name }}"
 
   tasks:
 
   - set_fact:
       owner: 167
       group: 167
-    when:
-      - ansible_os_family == "RedHat"
+    when: ansible_os_family == "RedHat"
   
   - set_fact:
       owner: 64045
       group: 64045
-    when:
-      - ansible_os_family == "Debian"
+    when: ansible_os_family == "Debian"
 
   - name: change partitions ownership
     file:
@@ -96,6 +93,5 @@
     with_subelements:
       - "{{ devices }}"
       - partitions
-    when:
-      item.0.device_name | match('/dev/(cciss/c[0-9]d[0-9]|nvme[0-9]n[0-9]){1,2}$')
-...
\ No newline at end of file
+    when: item.0.device_name | match('/dev/(cciss/c[0-9]d[0-9]|nvme[0-9]n[0-9]){1,2}$')
+...
index e999759edc18bffcec77f59861cd88ac21d31c42..dc7766c9585af2713bba2327b79dc09ab56794f0 100644 (file)
@@ -33,8 +33,7 @@
     osd_group_name: osds
     journal_typecode: 45b0969e-9b03-4f30-b4c6-b4b80ceff106
     osds_journal_devices: []
-  hosts:
-      - "{{ osd_group_name }}"
+  hosts: "{{ osd_group_name }}"
   serial: 1
   tasks:
 
@@ -51,8 +50,7 @@
         msg: exit playbook osd(s) is not on this host
     with_items: 
         osds_dir_stat.results
-    when:
-      -  osds_dir_stat is defined and item.stat.exists == false
+    when: osds_dir_stat is defined and item.stat.exists == false
 
   - name: install sgdisk(gdisk)
     package:
       --typecode={{ item.item[1].index }}:{{ journal_typecode }} 
       --partition-guid={{ item.item[1].index }}:{{ item.stdout }} 
       --mbrtogpt -- {{ item.item[0].device_name }}
-    with_items: 
-      - "{{ osds.results }}"
+    with_items:  "{{ osds.results }}"
 
   - name: stop osd(s) service
     service:
       name: "ceph-osd@{{ item.item[1].osd_id }}"
       state: stopped
-    with_items:
-      - "{{ osds.results }}"
+    with_items: "{{ osds.results }}"
 
   - name: flush osd(s) journal
     command: ceph-osd -i {{ item.item[1].osd_id }} --flush-journal --cluster {{ cluster }} 
-    with_items:
-      - "{{ osds.results }}"
+    with_items: "{{ osds.results }}"
     when: osds_journal_devices is defined
 
   - name: update osd(s) journal soft link
     command: ln -sf /dev/disk/by-partuuid/{{ item.stdout }} /var/lib/ceph/osd/{{ cluster }}-{{ item.item[1].osd_id }}/journal
-    with_items:
-      - "{{ osds.results }}"
+    with_items: "{{ osds.results }}"
 
   - name: update osd(s) journal uuid
     command: echo {{ item.stdout }} > /var/lib/ceph/osd/{{ cluster }}-{{ item.item[1].osd_id }}/journal_uuid
-    with_items:
-      - "{{ osds.results }}"
+    with_items: "{{ osds.results }}"
 
   - name: initialize osd(s) new journal 
     command: ceph-osd -i {{ item.item[1].osd_id }} --mkjournal --cluster {{ cluster }}
-    with_items:
-      - "{{ osds.results }}"
+    with_items: "{{ osds.results }}"
 
   - name: start osd(s) service
     service:
       name: "ceph-osd@{{ item.item[1].osd_id }}"
       state: started
-    with_items:
-      - "{{ osds.results }}"
+    with_items: "{{ osds.results }}"
index d19fe129c21321bf9d9b7acbe2277aa7a921c1d1..f1f4796c34fa4eb21073a1c034f94a7818b80916 100644 (file)
       --typecode={{ item.item[1].index }}:{{ journal_typecode }} 
       --partition-guid={{ item.item[1].index }}:{{ item.stdout }} 
       --mbrtogpt -- {{ item.item[0].device_name }}
-    with_items:
-      - "{{ osds_uuid.results }}"
+    with_items: "{{ osds_uuid.results }}"
 
   - name: stop osd(s) service
     service:
       name: "ceph-osd@{{ item.item[1].osd_id }}"
       state: stopped
-    with_items:
-      - "{{ osds_uuid.results }}"
+    with_items: "{{ osds_uuid.results }}"
 
   - name: reinitialize osd(s) journal in new ssd
     command: ceph-osd -i {{ item.item[1].osd_id }} --mkjournal --cluster {{ cluster }}
-    with_items:
-      - "{{ osds_uuid.results }}"
+    with_items: "{{ osds_uuid.results }}"
  
   - name: start osd(s) service
     service:
       name: "ceph-osd@{{ item.item[1].osd_id }}"
       state: started
-    with_items:
-       - "{{ osds_uuid.results }}"
+    with_items: "{{ osds_uuid.results }}"
index fc364097d5d28d39bc73c62464b639b7e3327aaf..bb9b67ce13ce2c2a9b832b604eb293ee83764a5b 100644 (file)
@@ -26,8 +26,7 @@
     - debug: msg="gather facts on all Ceph hosts for following reference"
 
 - name: confirm whether user really meant to replace osd(s)
-  hosts:
-    - localhost
+  hosts: localhost
   become: true
   vars_prompt:
     - name: ireallymeanit
@@ -90,8 +89,7 @@
       with_items: "{{ osd_hosts }}"
       delegate_to: "{{ item }}"
       failed_when: false
-      when:
-        - not containerized_deployment
+      when: not containerized_deployment
 
     - name: fail when admin key is not present
       fail:
         - "{{ osd_to_replace.split(',') }}"
       register: osd_to_replace_disks
       delegate_to: "{{ item.0 }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - name: zapping osd(s) - container
       shell: >
         - "{{ osd_hosts }}"
         - "{{ osd_to_replace_disks.results }}"
       delegate_to: "{{ item.0 }}"
-      when:
-        - containerized_deployment
+      when: containerized_deployment
 
     - 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
 
     - 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
 
     - name: replace osd(s) - prepare - non container
       command: ceph-disk prepare {{ item.1 }}  --osd-id {{ item.2 }} --osd-uuid $(uuidgen)
index 77714bb729b44773276647229c22aaba79d959dd..0923c3da91865c0bde59ed5d14727d5402e27de8 100644 (file)
@@ -56,8 +56,7 @@ EXAMPLES = '''
     location: "{{ hostvars[item]['osd_crush_location'] }}"
     containerized: "{{ docker_exec_cmd }}"
   with_items: "{{ groups[osd_group_name] }}"
-  when:
-    - crush_rule_config
+  when: crush_rule_config
 '''
 
 RETURN = '''#  '''
index cd274ee6346a1ef7693805b0a70252c372217273..f752a6096e30120c5ba766d3ea3c8315ef5dcba3 100644 (file)
@@ -9,22 +9,19 @@
   raw: apt-get -y install python-simplejson
   ignore_errors: yes
   register: result
-  when:
-    - systempython.stat is undefined or not systempython.stat.exists
+  when: systempython.stat is undefined or not systempython.stat.exists
   until: result is succeeded
 
 - name: install python for fedora
   raw: dnf -y install python3; ln -sf /usr/bin/python3 /usr/bin/python creates=/usr/bin/python
   ignore_errors: yes
   register: result
-  when:
-    - systempython.stat is undefined or not systempython.stat.exists
+  when: systempython.stat is undefined or not systempython.stat.exists
   until: (result is succeeded) and ('Failed' not in result.stdout)
 
 - name: install python for opensuse
   raw: zypper -n install python-base creates=/usr/bin/python2.7
   ignore_errors: yes
   register: result
-  when:
-    - systempython.stat is undefined or not systempython.stat.exists
-  until: result is succeeded
\ No newline at end of file
+  when: systempython.stat is undefined or not systempython.stat.exists
+  until: result is succeeded
index 3b1ed5d98342928c646f98591dce9d07219ec728..8a7890e271ef973610aeb239007af08c3e212e3e 100644 (file)
@@ -7,8 +7,7 @@
     state: present
   register: result
   until: result is succeeded
-  tags:
-    - package-install
+  tags: package-install
 
 - name: create minion.d directory
   file:
index 53070850bb417f37a4ab046b5e68046813a05e12..db6e2a3c9ea1423ed9e1344a7d322c32d6a2a4d7 100644 (file)
@@ -2,15 +2,13 @@
 - name: set_fact keys_tmp - preserve backward compatibility after the introduction of the ceph_keys module
   set_fact:
     keys_tmp: "{{ 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 } ] }}"
-  when:
-    - 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
+  when: 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
   with_items: "{{ keys }}"
 
 - name: set_fact keys - override keys_tmp with keys
   set_fact:
     keys: "{{ keys_tmp }}"
-  when:
-    - keys_tmp is defined
+  when: keys_tmp is defined
 
 # dummy container setup is only supported on x86_64
 # when running with containerized_deployment: true this task
@@ -22,8 +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)
 
 - name: set_fact delegated_node
   set_fact:
@@ -58,8 +55,7 @@
 - name: slurp client cephx key(s)
   slurp:
     src: "{{ ceph_conf_key_directory }}/{{ cluster }}.{{ item.name }}.keyring"
-  with_items:
-    - "{{ keys }}"
+  with_items: "{{ keys }}"
   register: slurp_client_keys
   delegate_to: "{{ delegated_node }}"
   when:
       with_items: "{{ pools | unique }}"
       changed_when: false
       delegate_to: "{{ delegated_node }}"
-      when:
-        - item.application is defined
+      when: item.application is defined
 
 - name: get client cephx keys
   copy:
     mode: "{{ item.item.get('mode', '0600') }}"
     owner: "{{ ceph_uid }}"
     group: "{{ ceph_uid }}"
-  with_items:
-    - "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] }}"
-  when:
-    - not item.get('skipped', False)
+  with_items: "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] }}"
+  when: not item.get('skipped', False)
index 87ea5fd700601de99d818215d495728d0e6bb731..86794bc4a37b1caaf25b5ffeeeeb4859cb58f1a7 100644 (file)
@@ -4,5 +4,4 @@
 
 - name: include create_users_keys.yml
   include_tasks: create_users_keys.yml
-  when:
-    - user_config
+  when: user_config
index 93d00a6dfde88c9b86167d8b6d818e72d34b3936..ab7e518535f048dd90bd969d4ed10ef74bb0727e 100644 (file)
@@ -6,8 +6,7 @@
     create: yes
     line: "CLUSTER={{ cluster }}"
     regexp: "^CLUSTER="
-  when:
-    - ansible_os_family in ["RedHat", "Suse"]
+  when: ansible_os_family in ["RedHat", "Suse"]
 
 # NOTE(leseb): we are performing the following check
 # to ensure any Jewel installation will not fail.
@@ -20,8 +19,7 @@
 # - All previous versions from Canonical
 # - Infernalis from ceph.com
 - name: debian based systems - configure cluster name
-  when:
-    - ansible_os_family == "Debian"
+  when: ansible_os_family == "Debian"
   block:
     - name: check /etc/default/ceph exist
       stat:
@@ -30,8 +28,7 @@
       check_mode: no
 
     - name: configure cluster name
-      when:
-        - etc_default_ceph.stat.exists
+      when: etc_default_ceph.stat.exists
       block:
         - name: when /etc/default/ceph is not dir
           lineinfile:
@@ -40,8 +37,7 @@
             create: yes
             regexp: "^CLUSTER="
             line: "CLUSTER={{ cluster }}"
-          when:
-            - not etc_default_ceph.stat.isdir
+          when: not etc_default_ceph.stat.isdir
 
         - name: when /etc/default/ceph is dir
           lineinfile:
@@ -50,5 +46,4 @@
             create: yes
             regexp: "^CLUSTER="
             line: "CLUSTER={{ cluster }}"
-          when:
-            - etc_default_ceph.stat.isdir
+          when: etc_default_ceph.stat.isdir
index 7810e1b3416d590126877f02b932abf5a13ee862..b76145777b722048580f8546778c8d76038a5dae 100644 (file)
@@ -9,8 +9,7 @@
   when:
     - ansible_os_family == 'Debian'
     - etc_default_ceph.stat.exists
-  notify:
-    - restart ceph osds
+  notify: restart ceph osds
 
 - name: configure TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES for redhat
   lineinfile:
@@ -19,7 +18,5 @@
     create: yes
     regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
     line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
-  when:
-    - ansible_os_family == 'RedHat'
-  notify:
-    - restart ceph osds
+  when: ansible_os_family == 'RedHat'
+  notify: restart ceph osds
index c55909d76947c03cbb69733add2371c29841db45..f893bbcfc5049e0ac6eb452a46d55be6e397016e 100644 (file)
@@ -9,5 +9,4 @@
   with_items:
     - "{{ rbd_client_admin_socket_path }}"
     - "{{ rbd_client_log_path }}"
-  when:
-    - rbd_client_directories
+  when: rbd_client_directories
index 27300ad7f639f0f269bd75bca95cfd59f4244f00..1a653b1987769f3ed1348f1113860452ebf3e854 100644 (file)
@@ -1,25 +1,20 @@
 ---
 - name: include debian_community_repository.yml
   include_tasks: debian_community_repository.yml
-  when:
-    - ceph_repository == 'community'
+  when: ceph_repository == 'community'
 
 - name: include debian_rhcs_repository.yml
   include_tasks: debian_rhcs_repository.yml
-  when:
-    - ceph_repository == 'rhcs'
+  when: ceph_repository == 'rhcs'
 
 - name: include debian_dev_repository.yml
   include_tasks: debian_dev_repository.yml
-  when:
-    - ceph_repository == 'dev'
+  when: ceph_repository == 'dev'
 
 - name: include debian_custom_repository.yml
   include_tasks: debian_custom_repository.yml
-  when:
-    - ceph_repository == 'custom'
+  when: ceph_repository == 'custom'
 
 - name: include debian_uca_repository.yml
   include_tasks: debian_uca_repository.yml
-  when:
-    - ceph_repository == 'uca'
\ No newline at end of file
+  when: ceph_repository == 'uca'
index 941f23929059c2e84b8a4e19c82309909b77dcca..6f18a11ba8f65bafe9147af496abc119cb3ba7b1 100644 (file)
@@ -3,29 +3,25 @@
   file:
     path: /tmp
     state: directory
-  when:
-    - use_installer
+  when: use_installer
 
 - name: use mktemp to create name for rundep
   command: "mktemp /tmp/rundep.XXXXXXXX"
   register: rundep_location
-  when:
-    - use_installer
+  when: use_installer
 
 - name: copy rundep
   copy:
     src: "{{ ansible_dir }}/rundep"
     dest: "{{ item }}"
   with_items: "{{ (rundep_location|default({})).stdout_lines|default([]) }}"
-  when:
-    - use_installer
+  when: use_installer
 
 - 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
 
 - name: ensure rsync is installed
   package:
index b0190df7fe2228e8bb340701d927b818cdd57ae0..a18801120bfbf6f0f91045d77c813117ddb6746e 100644 (file)
@@ -1,23 +1,19 @@
 ---
 - name: include redhat_community_repository.yml
   include_tasks: redhat_community_repository.yml
-  when:
-    - ceph_repository == 'community'
+  when: ceph_repository == 'community'
 
 - name: include redhat_rhcs_repository.yml
   include_tasks: redhat_rhcs_repository.yml
-  when:
-    - ceph_repository == 'rhcs'
+  when: ceph_repository == 'rhcs'
 
 - name: include redhat_dev_repository.yml
   include_tasks: redhat_dev_repository.yml
-  when:
-    - ceph_repository == 'dev'
+  when: ceph_repository == 'dev'
 
 - name: include redhat_custom_repository.yml
   include_tasks: redhat_custom_repository.yml
-  when:
-    - ceph_repository == 'custom'
+  when: ceph_repository == 'custom'
 
 # Remove yum caches so yum doesn't get confused if we are reinstalling a different ceph version
 - name: purge yum cache
@@ -25,5 +21,4 @@
   args:
     warn: no
   changed_when: false
-  when:
-    ansible_pkg_mgr == 'yum'
+  when: ansible_pkg_mgr == 'yum'
index 1e23e3ed3c3784093a68eb63a1fdb320cb75bfa5..689cbd915f2db605b995c5491cde5e6defa22964 100644 (file)
@@ -1,5 +1,4 @@
 ---
 - name: include suse_obs_repository.yml
   include_tasks: suse_obs_repository.yml
-  when:
-    - ceph_repository == 'obs'
+  when: ceph_repository == 'obs'
index 4638a991e701cbc34c2b7f99bed82a6b58c7ef5c..2006543171ebcba7904a65ffe4cd472df516651b 100644 (file)
@@ -9,10 +9,8 @@
 
 - name: include prerequisite_rhcs_iso_install_debian.yml
   include_tasks: prerequisite_rhcs_iso_install_debian.yml
-  when:
-    - ceph_repository_type == 'iso'
+  when: ceph_repository_type == 'iso'
 
 - name: include prerequisite_rhcs_cdn_install_debian.yml
   include_tasks: prerequisite_rhcs_cdn_install_debian.yml
-  when:
-    - ceph_repository_type == 'cdn'
+  when: ceph_repository_type == 'cdn'
index 9a3978f001955c7cd78511cb41a4701a88f8f88f..78143a61ace59d6d9d3830e6527f20c95e73d1e7 100644 (file)
@@ -1,8 +1,7 @@
 ---
 - name: include configure_debian_repository_installation.yml
   include_tasks: configure_debian_repository_installation.yml
-  when:
-    - ceph_origin == 'repository'
+  when: ceph_origin == 'repository'
 
 - name: update apt cache if cache_valid_time has expired
   apt:
index 52e4eb0e79bd9817c882c6f96b15962b3b7655b2..93e261484b5dfe113f190f79223ded94be31b511 100644 (file)
@@ -1,15 +1,12 @@
 ---
 - name: include configure_redhat_repository_installation.yml
   include_tasks: configure_redhat_repository_installation.yml
-  when:
-    - ceph_origin == 'repository'
+  when: ceph_origin == 'repository'
 
 - name: include configure_redhat_local_installation.yml
   include_tasks: configure_redhat_local_installation.yml
-  when:
-    - ceph_origin == 'local'
+  when: ceph_origin == 'local'
 
 - name: include install_redhat_packages.yml
   include_tasks: install_redhat_packages.yml
-  when:
-    - (ceph_origin == 'repository' or ceph_origin == 'distro')
+  when: (ceph_origin == 'repository' or ceph_origin == 'distro')
index 50aa97e52c5c1b528dc6a64d7fea782d7cbc8838..e185d56ddbfc68d3bd05892069172ebd22f7595c 100644 (file)
@@ -5,13 +5,11 @@
 - name: Check for supported installation method on suse
   fail:
     msg: "Unsupported installation method origin:{{ ceph_origin }} repo:{{ ceph_repository }}'"
-  when:
-    - ceph_origin != 'distro' or (ceph_origin == 'repository' and ceph_repository != 'obs')
+  when: ceph_origin != 'distro' or (ceph_origin == 'repository' and ceph_repository != 'obs')
 
 - name: include configure_suse_repository_installation.yml
   include_tasks: configure_suse_repository_installation.yml
-  when:
-    - ceph_origin == 'repository'
+  when: ceph_origin == 'repository'
 
 - name: install dependencies
   zypper:
index d692c175896acdfcdffc03fe99e5d41e3b4a48f8..28b56fd9ac491b3e6603bbcc30720a3126c151ce 100644 (file)
@@ -5,8 +5,7 @@
     state: present
   register: result
   until: result is succeeded
-  when:
-    - ansible_distribution == 'RedHat'
+  when: ansible_distribution == 'RedHat'
 
 - name: install centos dependencies
   yum:
     state: present
   register: result
   until: result is succeeded
-  when:
-    - ansible_distribution == 'CentOS'
+  when: ansible_distribution == 'CentOS'
 
 - name: install redhat ceph packages
   package:
     name: "{{ redhat_ceph_pkgs | unique }}"
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   register: result
-  until: result is succeeded
\ No newline at end of file
+  until: result is succeeded
index 7deeedd82da598f193dff74effc4eb4aee316cc9..648a10e3b30d8f019f4473ed7a62e61c5aa07051 100644 (file)
@@ -2,17 +2,14 @@
 - name: enable red hat storage monitor repository
   rhsm_repository:
     name: "rhel-7-server-rhceph-{{ ceph_rhcs_version }}-mon-rpms"
-  when:
-    - (mon_group_name in group_names or mgr_group_name in group_names)
+  when: (mon_group_name in group_names or mgr_group_name in group_names)
 
 - name: enable red hat storage osd repository
   rhsm_repository:
     name: "rhel-7-server-rhceph-{{ ceph_rhcs_version }}-osd-rpms"
-  when:
-    - osd_group_name in group_names
+  when: osd_group_name in group_names
 
 - name: enable red hat storage tools repository
   rhsm_repository:
     name: "rhel-7-server-rhceph-{{ ceph_rhcs_version }}-tools-rpms"
-  when:
-    - (rgw_group_name in group_names or mds_group_name in group_names or nfs_group_name in group_names or iscsi_gw_group_name in group_names or client_group_name in group_names)
\ No newline at end of file
+  when: (rgw_group_name in group_names or mds_group_name in group_names or nfs_group_name in group_names or iscsi_gw_group_name in group_names or client_group_name in group_names)
index b6a7728c3d9925e305f6cb9179c53e94be6dde5a..0b7783a4cf54eca001c9c0f7636cd06553ed7a3b 100644 (file)
@@ -12,8 +12,7 @@
     path: "{{ ceph_rhcs_iso_path | dirname }}"
     state: directory
     recurse: yes
-  when:
-    - ceph_rhcs_iso_path | dirname != '/'
+  when: ceph_rhcs_iso_path | dirname != '/'
 
 - name: fetch the red hat storage iso from the ansible server for redhat systems
   copy:
index 177abc672df90b261df76adeabe902b553d40ad5..ade0364ac5c7ccc47b21da33e81837dd286b4ddd 100644 (file)
@@ -12,8 +12,7 @@
     path: "{{ ceph_rhcs_iso_path | dirname }}"
     state: directory
     recurse: yes
-  when:
-    - ceph_rhcs_iso_path | dirname != '/'
+  when: ceph_rhcs_iso_path | dirname != '/'
 
 - name: fetch the red hat storage iso from the ansible server for debian systems
   copy:
index 435d10c72b0a75158bbb98ada48b0e87fd5147a1..332491d4a5faab0839bc7f57c54cf83548de9857 100644 (file)
@@ -4,8 +4,7 @@
     name: yum-plugin-priorities
   register: result
   until: result is succeeded
-  tags:
-    - with_pkg
+  tags: with_pkg
 
 - name: configure red hat ceph community repository stable key
   rpm_key:
@@ -38,4 +37,4 @@
     file: ceph_stable
     priority: 2
   register: result
-  until: result is succeeded
\ No newline at end of file
+  until: result is succeeded
index cfb5e481a5cccf3bb1fcecf7bded461d0a41e232..78cfca717a5e9d66f2a947deb91d9f86683777b7 100644 (file)
@@ -1,10 +1,8 @@
 ---
 - name: include prerequisite_rhcs_iso_install.yml
   include_tasks: prerequisite_rhcs_iso_install.yml
-  when:
-    - ceph_repository_type == 'iso'
+  when: ceph_repository_type == 'iso'
 
 - name: include prerequisite_rhcs_cdn_install.yml
   include_tasks: prerequisite_rhcs_cdn_install.yml
-  when:
-    - ceph_repository_type == 'cdn'
+  when: ceph_repository_type == 'cdn'
index fceb190b988d97eeb595439a8b7c43b140276801..6c33f9b71ae4c70f7442c79616a1469c50938c48 100644 (file)
@@ -2,27 +2,22 @@
 - name: include_tasks installs/install_on_redhat.yml
   include_tasks: installs/install_on_redhat.yml
   when: ansible_os_family == 'RedHat'
-  tags:
-    - package-install
+  tags: package-install
 
 - name: include_tasks installs/install_on_suse.yml
   include_tasks: installs/install_on_suse.yml
   when: ansible_os_family == 'Suse'
-  tags:
-    - package-install
+  tags: package-install
 
 - name: include installs/install_on_debian.yml
   include_tasks: installs/install_on_debian.yml
-  tags:
-    - package-install
-  when:
-    - ansible_os_family == 'Debian'
+  tags: package-install
+  when: ansible_os_family == 'Debian'
 
 - name: include_tasks installs/install_on_clear.yml
   include_tasks: installs/install_on_clear.yml
   when: ansible_os_family == 'ClearLinux'
-  tags:
-    - package-install
+  tags: package-install
 
 - name: get ceph version
   command: ceph --version
 # override ceph_stable_release for ceph_dev and rhcs installations since ceph_stable_release is not mandatory
 - name: include release-rhcs.yml
   include_tasks: release-rhcs.yml
-  when:
-    - ceph_repository in ['rhcs', 'dev']
+  when: ceph_repository in ['rhcs', 'dev']
       or
       ceph_origin == 'distro'
-  tags:
-    - always
+  tags: always
 
 - name: set_fact ceph_release - override ceph_release with ceph_stable_release
   set_fact:
@@ -50,8 +43,7 @@
   when:
     - ceph_origin == 'repository'
     - ceph_repository not in ['dev', 'rhcs']
-  tags:
-    - always
+  tags: always
 
 - name: include create_rbd_client_dir.yml
   include_tasks: create_rbd_client_dir.yml
index d0ac6d3a47086adb00fc5fabc4faeac7bc365f35..eee58e0744a3ca514acd364f2f914895295ca047 100644 (file)
@@ -2,29 +2,24 @@
 - name: set_fact ceph_release jewel
   set_fact:
     ceph_release: jewel
-  when:
-    - ceph_version.split('.')[0] is version_compare('10', '==')
+  when: ceph_version.split('.')[0] is version_compare('10', '==')
 
 - name: set_fact ceph_release kraken
   set_fact:
     ceph_release: kraken
-  when:
-    - ceph_version.split('.')[0] is version_compare('11', '==')
+  when: ceph_version.split('.')[0] is version_compare('11', '==')
 
 - name: set_fact ceph_release luminous
   set_fact:
     ceph_release: luminous
-  when:
-    - ceph_version.split('.')[0] is version_compare('12', '==')
+  when: ceph_version.split('.')[0] is version_compare('12', '==')
 
 - name: set_fact ceph_release mimic
   set_fact:
     ceph_release: mimic
-  when:
-    - ceph_version.split('.')[0] is version_compare('13', '==')
+  when: ceph_version.split('.')[0] is version_compare('13', '==')
 
 - name: set_fact ceph_release nautilus
   set_fact:
     ceph_release: nautilus
-  when:
-    - ceph_version.split('.')[0] is version_compare('14', '==')
+  when: ceph_version.split('.')[0] is version_compare('14', '==')
index 05f4700ad40c58d795bc6a5b7b35aa90c50ccbca..29f6071ad05e5abe76b4d1d95bc2cd917c030bfa 100644 (file)
@@ -1,8 +1,7 @@
 ---
 - 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:
@@ -14,8 +13,7 @@
   - name: count number of osds for lvm scenario
     set_fact:
       num_osds: "{{ lvm_volumes | length | int }}"
-    when:
-      - lvm_volumes | default([]) | length > 0
+    when: lvm_volumes | default([]) | length > 0
 
   - name: run 'ceph-volume lvm batch --report' to see how many osds are to be created
     ceph_volume:
@@ -33,8 +31,7 @@
       CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
       CEPH_CONTAINER_BINARY: "{{ container_binary }}"
       PYTHONIOENCODING: utf-8
-    when:
-      - devices | default([]) | length > 0
+    when: devices | default([]) | length > 0
 
   - name: set_fact num_osds from the output of 'ceph-volume lvm batch --report'
     set_fact:
@@ -65,8 +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:
       state: directory
       mode: "0755"
     delegate_to: localhost
-    when:
-      - ceph_conf_local
+    when: ceph_conf_local
 
   - name: "generate {{ cluster }}.conf configuration file locally"
     config_template:
       - ceph_conf_local
 
 - 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:
index 040a0f493c2f0245b288a43f4727afdf2bf7792a..f894111b3c05ce7e09fec60a68d2cdd1e0e4be29 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)
 
 - 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 }}"
 - name: set_fact image_repodigest_after_pulling
   set_fact:
     image_repodigest_after_pulling: "{{ (image_inspect_after_pull.stdout | from_json)[0].RepoDigests[0].split('@')[1] }}"
-  when:
-    - image_inspect_after_pull.rc == 0
+  when: image_inspect_after_pull.rc == 0
 
 - name: set_fact ceph_mon_image_updated
   set_fact:
     ceph_mon_image_updated: "{{ ceph_mon_image_repodigest_before_pulling != image_repodigest_after_pulling }}"
   changed_when: true
-  notify:
-    - restart ceph mons
+  notify: restart ceph mons
   when:
     - mon_group_name in group_names
     - ceph_mon_container_inspect_before_pull.get('rc') == 0
   set_fact:
     ceph_osd_image_updated: "{{ ceph_osd_image_repodigest_before_pulling != image_repodigest_after_pulling }}"
   changed_when: true
-  notify:
-    - restart ceph osds
+  notify: restart ceph osds
   when:
     - osd_group_name in group_names
     - ceph_osd_container_inspect_before_pull.get('rc') == 0
   set_fact:
     ceph_mds_image_updated: "{{ ceph_mds_image_repodigest_before_pulling != image_repodigest_after_pulling }}"
   changed_when: true
-  notify:
-    - restart ceph mdss
+  notify: restart ceph mdss
   when:
     - mds_group_name in group_names
     - ceph_mds_container_inspect_before_pull.get('rc') == 0
   set_fact:
     ceph_rgw_image_updated: "{{ ceph_rgw_image_repodigest_before_pulling != image_repodigest_after_pulling }}"
   changed_when: true
-  notify:
-    - restart ceph rgws
+  notify: restart ceph rgws
   when:
     - rgw_group_name in group_names
     - ceph_rgw_container_inspect_before_pull.get('rc') == 0
   set_fact:
     ceph_mgr_image_updated: "{{ ceph_mgr_image_repodigest_before_pulling != image_repodigest_after_pulling }}"
   changed_when: true
-  notify:
-    - restart ceph mgrs
+  notify: restart ceph mgrs
   when:
     - mgr_group_name in group_names
     - ceph_mgr_container_inspect_before_pull.get('rc') == 0
   set_fact:
     ceph_rbd_mirror_image_updated: "{{ ceph_rbd_mirror_image_repodigest_before_pulling != image_repodigest_after_pulling }}"
   changed_when: true
-  notify:
-    - restart ceph rbdmirrors
+  notify: restart ceph rbdmirrors
   when:
     - rbdmirror_group_name in group_names
     - ceph_rbd_mirror_container_inspect_before_pull.get('rc') == 0
   set_fact:
     ceph_nfs_image_updated: "{{ ceph_nfs_image_repodigest_before_pulling != image_repodigest_after_pulling }}"
   changed_when: true
-  notify:
-    - restart ceph nfss
+  notify: restart ceph nfss
   when:
     - nfs_group_name in group_names
     - ceph_nfs_container_inspect_before_pull.get('rc') == 0
     {{ container_binary }} save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
     "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
   delegate_to: localhost
-  when:
-    - (ceph_docker_dev_image is defined and ceph_docker_dev_image)
+  when: (ceph_docker_dev_image is defined and ceph_docker_dev_image)
   run_once: true
 
 - name: copy ceph dev image file
   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)
 
 - 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)
 
 - 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)
+
index 418d3594a818e857d37d6f9a1070649cda506ed8..9062c072bd63bf1217cfe366b3d9c7dd06d4279a 100644 (file)
@@ -1,27 +1,23 @@
 ---
 - name: include pre_requisites/prerequisites.yml
   include_tasks: pre_requisites/prerequisites.yml
-  when:
-    - not is_atomic
+  when: not is_atomic
 
 - name: get docker version
   command: docker --version
   changed_when: false
   check_mode: no
   register: ceph_docker_version
-  when:
-    - container_binary == 'docker'
+  when: container_binary == 'docker'
 
 - name: set_fact ceph_docker_version ceph_docker_version.stdout.split
   set_fact:
     ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
-  when:
-    - container_binary == 'docker'
+  when: container_binary == 'docker'
 
 - name: include fetch_image.yml
   include_tasks: fetch_image.yml
-  tags:
-    - fetch_container_image
+  tags: fetch_container_image
 
 - name: get ceph version
   command: >
@@ -37,4 +33,4 @@
     ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}"
 
 - name: include release.yml
-  include_tasks: release.yml
\ No newline at end of file
+  include_tasks: release.yml
index 737c5c139abbbe78f236237cb1871984ac205ca0..f64995b787dc53a1b2901d4784095af56892ac53 100644 (file)
@@ -13,8 +13,7 @@
   when:
     - ansible_os_family == 'Debian'
     - container_package_name == 'docker-ce'
-  tags:
-    with_pkg
+  tags: with_pkg
 
 # ensure extras enabled for docker
 - name: enable extras on centos
@@ -32,8 +31,7 @@
   package:
     name: ['{{ container_package_name }}', '{{ container_binding_name }}']
     update_cache: true
-  tags:
-    with_pkg
+  tags: with_pkg
 
 - name: start container service
   service:
index d0ac6d3a47086adb00fc5fabc4faeac7bc365f35..0f0980668d041a4960c7e424fa1114b06512b48a 100644 (file)
@@ -2,29 +2,25 @@
 - name: set_fact ceph_release jewel
   set_fact:
     ceph_release: jewel
-  when:
-    - ceph_version.split('.')[0] is version_compare('10', '==')
+  when: ceph_version.split('.')[0] is version_compare('10', '==')
 
 - name: set_fact ceph_release kraken
   set_fact:
     ceph_release: kraken
-  when:
-    - ceph_version.split('.')[0] is version_compare('11', '==')
+  when: ceph_version.split('.')[0] is version_compare('11', '==')
 
 - name: set_fact ceph_release luminous
   set_fact:
     ceph_release: luminous
-  when:
-    - ceph_version.split('.')[0] is version_compare('12', '==')
+  when: ceph_version.split('.')[0] is version_compare('12', '==')
 
 - name: set_fact ceph_release mimic
   set_fact:
     ceph_release: mimic
-  when:
-    - ceph_version.split('.')[0] is version_compare('13', '==')
+  when: ceph_version.split('.')[0] is version_compare('13', '==')
 
 - name: set_fact ceph_release nautilus
   set_fact:
     ceph_release: nautilus
-  when:
-    - ceph_version.split('.')[0] is version_compare('14', '==')
+  when: ceph_version.split('.')[0] is version_compare('14', '==')
+
index ca1470064e278f915d811f75f49a53ca53828729..74de769aa708d70aa06829025c5aa9b619777622 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
 
 - name: set_fact monitor_name ansible_fqdn
   set_fact:
     monitor_name: "{{ ansible_fqdn }}"
-  when:
-    - mon_use_fqdn
+  when: mon_use_fqdn
 
 - name: set_fact docker_exec_cmd
   set_fact:
@@ -67,8 +65,7 @@
   set_fact:
     ceph_current_status:
       rc: 1
-  when:
-    - rolling_update or groups.get(mon_group_name, []) | length == 0
+  when: rolling_update or groups.get(mon_group_name, []) | length == 0
 
 - name: create a local fetch directory if it does not exist
   file:
   delegate_to: localhost
   changed_when: false
   become: false
-  when:
-    - (cephx or generate_fsid)
+  when: cephx or generate_fsid
 
 - name: get current fsid
   command: "{{ timeout_command }} {{ docker_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
 
 - name: set_fact fsid
   set_fact:
     fsid: "{{ (rolling_update_fsid.stdout | from_json).fsid }}"
-  when:
-    - rolling_update
+  when: rolling_update
 
 - name: set_fact ceph_current_status (convert to json)
   set_fact:
 - name: set_fact fsid from ceph_current_status
   set_fact:
     fsid: "{{ ceph_current_status.fsid }}"
-  when:
-    - ceph_current_status.fsid is defined
+  when: ceph_current_status.fsid is defined
 
 - name: fsid realted tasks
   when:
 - name: set_fact mds_name ansible_hostname
   set_fact:
     mds_name: "{{ ansible_hostname }}"
-  when:
-    - not mds_use_fqdn
+  when: not mds_use_fqdn
 
 - name: set_fact mds_name ansible_fqdn
   set_fact:
     mds_name: "{{ ansible_fqdn }}"
-  when:
-    - mds_use_fqdn
+  when: mds_use_fqdn
 
 - name: set_fact rbd_client_directory_owner ceph
   set_fact:
     rbd_client_directory_owner: ceph
-  when:
-    - rbd_client_directory_owner is not defined
+  when: rbd_client_directory_owner is not defined
       or not rbd_client_directory_owner
 
 - name: set_fact rbd_client_directory_group rbd_client_directory_group
   set_fact:
     rbd_client_directory_group: ceph
-  when:
-    - rbd_client_directory_group is not defined
+  when: rbd_client_directory_group is not defined
       or not rbd_client_directory_group
 
 - name: set_fact rbd_client_directory_mode 0770
   set_fact:
     rbd_client_directory_mode: "0770"
-  when:
-    - rbd_client_directory_mode is not defined
+  when: rbd_client_directory_mode is not defined
       or not rbd_client_directory_mode
 
 - name: resolve device link(s)
 
 - name: import_tasks set_radosgw_address.yml
   import_tasks: set_radosgw_address.yml
-  when:
-    - inventory_hostname in groups.get(rgw_group_name, [])
+  when: inventory_hostname in groups.get(rgw_group_name, [])
 
 - name: set_fact rgw_instances
   set_fact:
     rgw_instances: "{{ rgw_instances|default([]) | union([{'instance_name': 'rgw' + item|string, 'radosgw_address': _radosgw_address, 'radosgw_frontend_port': radosgw_frontend_port|int + item|int}]) }}"
   with_sequence: start=0 end={{ radosgw_num_instances|int - 1 }}
-  when:
-    - inventory_hostname in groups.get(rgw_group_name, [])
+  when: inventory_hostname in groups.get(rgw_group_name, [])
 
 - name: set ntp service name depending on OS family
   block:
index 09a08bd4dc366595a3b19cda0431b289319c26c1..f92df413411cd6817e2e152dc8b6b40ebcf75754 100644 (file)
@@ -2,8 +2,7 @@
 - name: set_fact _monitor_address to monitor_address_block ipv4
   set_fact:
     _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_all_ipv4_addresses'] | ipaddr(hostvars[item]['monitor_address_block']) | first }] }}"
-  with_items:
-    - "{{ groups.get(mon_group_name, []) }}"
+  with_items: "{{ groups.get(mon_group_name, []) }}"
   when:
     - "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') |  map(attribute='name') | list"
     - hostvars[item]['monitor_address_block'] is defined
@@ -13,8 +12,7 @@
 - name: set_fact _monitor_address to monitor_address_block ipv6
   set_fact:
     _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_all_ipv6_addresses'] | ipaddr(hostvars[item]['monitor_address_block']) | last | ipwrap }] }}"
-  with_items:
-    - "{{ groups.get(mon_group_name, []) }}"
+  with_items: "{{ groups.get(mon_group_name, []) }}"
   when:
     - "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') |  map(attribute='name') | list"
     - hostvars[item]['monitor_address_block'] is defined
@@ -24,8 +22,7 @@
 - name: set_fact _monitor_address to monitor_address
   set_fact:
     _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['monitor_address'] | ipwrap}] }}"
-  with_items:
-    - "{{ groups.get(mon_group_name, []) }}"
+  with_items: "{{ groups.get(mon_group_name, []) }}"
   when:
     - "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
     - hostvars[item]['monitor_address'] is defined
@@ -34,8 +31,7 @@
 - name: set_fact _monitor_address to monitor_interface - ipv4
   set_fact:
     _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_' + (hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version]['address'] | ipwrap }]  }}"
-  with_items:
-    - "{{ groups.get(mon_group_name, []) }}"
+  with_items: "{{ groups.get(mon_group_name, []) }}"
   when:
     - "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
     - ip_version == 'ipv4'
@@ -46,8 +42,7 @@
 - name: set_fact _monitor_address to monitor_interface - ipv6
   set_fact:
     _monitor_addresses: "{{ _monitor_addresses | default([]) + [{ 'name': item, 'addr': hostvars[item]['ansible_' + (hostvars[item]['monitor_interface']|replace('-', '_'))][ip_version][0]['address'] | ipwrap }] }}"
-  with_items:
-    - "{{ groups.get(mon_group_name, []) }}"
+  with_items: "{{ groups.get(mon_group_name, []) }}"
   when:
     - "item not in _monitor_addresses | default([]) | selectattr('name', 'defined') | map(attribute='name') | list"
     - ip_version == 'ipv6'
index 6e4fb1cd537ae34a7fa215376ff446568f452b7a..1ff6f71fa14b70502c46c5669f90d8bf041d02d2 100644 (file)
   - name: set_fact _radosgw_address to radosgw_interface - ipv4
     set_fact:
       _radosgw_address: "{{ hostvars[inventory_hostname][_interface][ip_version]['address'] }}"
-    when:
-      - ip_version == 'ipv4'
+    when: ip_version == 'ipv4'
 
   - name: set_fact _radosgw_address to radosgw_interface - ipv6
     set_fact:
       _radosgw_address: "{{ hostvars[inventory_hostname][_interface][ip_version][0]['address'] }}"
-    when:
-      - ip_version == 'ipv6'
+    when: ip_version == 'ipv6'
index 14d01612da53119ad5f7c9e75878ca5c72767abe..9333b9cc2daa859d3c9b6b92491c58f72ebaf8e6 100644 (file)
@@ -5,8 +5,7 @@
     - name: update apt cache
       apt:
         update-cache: yes
-      when:
-        - ansible_os_family == 'Debian'
+      when: ansible_os_family == 'Debian'
       register: result
       until: result is succeeded
 
         group: root
         mode: 0750
       listen: "restart ceph mdss"
-      when:
-        - mds_group_name in group_names
+      when: mds_group_name in group_names
 
     - name: restart ceph mds daemon(s) - non container
       command: /usr/bin/env bash /tmp/restart_mds_daemon.sh
         group: root
         mode: 0750
       listen: "restart ceph rgws"
-      when:
-        - rgw_group_name in group_names
+      when: rgw_group_name in group_names
 
     - name: restart ceph rgw daemon(s) - non container
       command: /usr/bin/env bash /tmp/restart_rgw_daemon.sh
         group: root
         mode: 0750
       listen: "restart ceph nfss"
-      when:
-        - nfs_group_name in group_names
+      when: nfs_group_name in group_names
 
     - name: restart ceph nfs daemon(s) - non container
       command: /usr/bin/env bash /tmp/restart_nfs_daemon.sh
         group: root
         mode: 0750
       listen: "restart ceph rbdmirrors"
-      when:
-        - rbdmirror_group_name in group_names
+      when: rbdmirror_group_name in group_names
 
     - name: restart ceph rbd mirror daemon(s) - non container
       command: /usr/bin/env bash /tmp/restart_rbd_mirror_daemon.sh
         group: root
         mode: 0750
       listen: "restart ceph mgrs"
-      when:
-        - mgr_group_name in group_names
+      when: mgr_group_name in group_names
 
     - name: restart ceph mgr daemon(s) - non container
       command: /usr/bin/env bash /tmp/restart_mgr_daemon.sh
         group: root
         mode: 0750
       listen: "restart ceph tcmu-runner"
-      when:
-        - iscsi_gw_group_name in group_names
+      when: iscsi_gw_group_name in group_names
 
     - name: restart tcmu-runner
       command: /usr/bin/env bash /tmp/restart_tcmu_runner.sh
         group: root
         mode: 0750
       listen: "restart ceph rbd-target-gw"
-      when:
-        - iscsi_gw_group_name in group_names
+      when: iscsi_gw_group_name in group_names
 
     - name: restart rbd-target-gw
       command: /usr/bin/env bash /tmp/restart_rbd_target_gw.sh
         group: root
         mode: 0750
       listen: "restart ceph rbd-target-api"
-      when:
-        - iscsi_gw_group_name in group_names
+      when: iscsi_gw_group_name in group_names
 
     - name: restart rbd-target-api
       command: /usr/bin/env bash /tmp/restart_rbd_target_api.sh
index 0418d2ffed4b34ef3d06de49c7b2e17ccfeb550e..0f08a0ae36e8e25e1762290b6f0b216254f58404 100644 (file)
@@ -1,10 +1,8 @@
 ---
 - name: include check_running_containers.yml
   include_tasks: check_running_containers.yml
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: include check_socket_non_container.yml
   include_tasks: check_socket_non_container.yml
-  when:
-    - not containerized_deployment
+  when: not containerized_deployment
index c0590fe419d7090bab437ca16754df53f4d87ff6..6720c8085a02e4593b48b4077bfaac9ccbcb5c1d 100644 (file)
@@ -5,8 +5,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(mon_group_name, [])
+  when: inventory_hostname in groups.get(mon_group_name, [])
 
 - name: check for an osd container
   command: "{{ container_binary }} ps -q --filter='name=ceph-osd'"
@@ -14,8 +13,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(osd_group_name, [])
+  when: inventory_hostname in groups.get(osd_group_name, [])
 
 - name: check for a mds container
   command: "{{ container_binary }} ps -q --filter='name=ceph-mds-{{ ansible_hostname }}'"
@@ -23,8 +21,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(mds_group_name, [])
+  when: inventory_hostname in groups.get(mds_group_name, [])
 
 - name: check for a rgw container
   command: "{{ container_binary }} ps -q --filter='name=ceph-rgw-{{ ansible_hostname }}'"
@@ -32,8 +29,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(rgw_group_name, [])
+  when: inventory_hostname in groups.get(rgw_group_name, [])
 
 - name: check for a mgr container
   command: "{{ container_binary }} ps -q --filter='name=ceph-mgr-{{ ansible_hostname }}'"
@@ -41,8 +37,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(mgr_group_name, [])
+  when: inventory_hostname in groups.get(mgr_group_name, [])
 
 - name: check for a rbd mirror container
   command: "{{ container_binary }} ps -q --filter='name=ceph-rbd-mirror-{{ ansible_hostname }}'"
@@ -50,8 +45,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(rbdmirror_group_name, [])
+  when: inventory_hostname in groups.get(rbdmirror_group_name, [])
 
 - name: check for a nfs container
   command: "{{ container_binary }} ps -q --filter='name=ceph-nfs-{{ ansible_hostname }}'"
@@ -59,8 +53,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(nfs_group_name, [])
+  when: inventory_hostname in groups.get(nfs_group_name, [])
 
 - name: check for a tcmu-runner container
   command: "{{ container_binary }} ps -q --filter='name=tcmu-runner'"
@@ -68,8 +61,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(iscsi_gw_group_name, [])
+  when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
 
 - name: check for a rbd-target-api container
   command: "{{ container_binary }} ps -q --filter='name=rbd-target-api'"
@@ -77,8 +69,7 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(iscsi_gw_group_name, [])
+  when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
 
 - name: check for a rbd-target-gw container
   command: "{{ container_binary }} ps -q --filter='name=rbd-target-gw'"
@@ -86,5 +77,4 @@
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(iscsi_gw_group_name, [])
+  when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
index 0afe3eaa807d34eadd50193af20573043cad24f9..689858026478a78edbb4c4a5485d9b88bdcfc2e3 100644 (file)
@@ -5,8 +5,7 @@
   failed_when: false
   check_mode: no
   register: mon_socket_stat
-  when:
-    - inventory_hostname in groups.get(mon_group_name, [])
+  when: inventory_hostname in groups.get(mon_group_name, [])
 
 - name: check if the ceph mon socket is in-use
   command: fuser --silent {{ mon_socket_stat.stdout }}
@@ -34,8 +33,7 @@
   failed_when: false
   check_mode: no
   register: osd_socket_stat
-  when:
-    - inventory_hostname in groups.get(osd_group_name, [])
+  when: inventory_hostname in groups.get(osd_group_name, [])
 
 - name: check if the ceph osd socket is in-use
   command: fuser --silent {{ osd_socket_stat.stdout }}
@@ -63,8 +61,7 @@
   failed_when: false
   check_mode: no
   register: mds_socket_stat
-  when:
-    - inventory_hostname in groups.get(mds_group_name, [])
+  when: inventory_hostname in groups.get(mds_group_name, [])
 
 - name: check if the ceph mds socket is in-use
   command: fuser --silent {{ mds_socket_stat.stdout }}
@@ -92,8 +89,7 @@
   failed_when: false
   check_mode: no
   register: rgw_socket_stat
-  when:
-    - inventory_hostname in groups.get(rgw_group_name, [])
+  when: inventory_hostname in groups.get(rgw_group_name, [])
 
 - name: check if the ceph rgw socket is in-use
   command: fuser --silent {{ rgw_socket_stat.stdout }}
   failed_when: false
   check_mode: no
   register: mgr_socket_stat
-  when:
-    - inventory_hostname in groups.get(mgr_group_name, [])
+  when: inventory_hostname in groups.get(mgr_group_name, [])
 
 - name: check if the ceph mgr socket is in-use
   command: fuser --silent {{ mgr_socket_stat.stdout }}
   failed_when: false
   check_mode: no
   register: rbd_mirror_socket_stat
-  when:
-    - inventory_hostname in groups.get(rbdmirror_group_name, [])
+  when: inventory_hostname in groups.get(rbdmirror_group_name, [])
 
 - name: check if the ceph rbd mirror socket is in-use
   command: fuser --silent {{ rbd_mirror_socket_stat.stdout }}
   failed_when: false
   check_mode: no
   register: nfs_socket_stat
-  when:
-    - inventory_hostname in groups.get(nfs_group_name, [])
+  when: inventory_hostname in groups.get(nfs_group_name, [])
 
 - name: check if the ceph nfs ganesha socket is in-use
   command: fuser --silent {{ nfs_socket_stat.stdout }}
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(iscsi_gw_group_name, [])
+  when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
 
 - name: check for a rbd-target-api
   command: "pgrep rbd-target-api"
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(iscsi_gw_group_name, [])
+  when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
 
 - name: check for a rbd-target-gw
   command: "pgrep name=rbd-target-gw"
   changed_when: false
   failed_when: false
   check_mode: no
-  when:
-    - inventory_hostname in groups.get(iscsi_gw_group_name, [])
+  when: inventory_hostname in groups.get(iscsi_gw_group_name, [])
index 6bfe58047998633cfb393fc5b05c5c1e309abf9c..dc89664e43f0ab9058ca5850e4f90fd779c11c82 100644 (file)
@@ -7,13 +7,10 @@
   ignore_errors: true
   check_mode: no
   changed_when: false
-  tags:
-    - firewall
-  when:
-    - not containerized_deployment
+  tags: firewall
+  when: not containerized_deployment
 
-- when:
-    - (firewalld_pkg_query.get('rc', 1) == 0
+- when: (firewalld_pkg_query.get('rc', 1) == 0
       or is_atomic)
   block:
   - name: start firewalld
@@ -36,8 +33,7 @@
     when:
       - mon_group_name is defined
       - mon_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open manager ports
     firewalld:
@@ -50,8 +46,7 @@
     when:
       - mgr_group_name is defined
       - mgr_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open osd ports
     firewalld:
@@ -67,8 +62,7 @@
     when:
       - osd_group_name is defined
       - osd_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open rgw ports
     firewalld:
@@ -81,8 +75,7 @@
     when:
       - rgw_group_name is defined
       - rgw_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open mds ports
     firewalld:
@@ -95,8 +88,7 @@
     when:
       - mds_group_name is defined
       - mds_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open nfs ports
     firewalld:
     when:
       - nfs_group_name is defined
       - nfs_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open nfs ports (portmapper)
     firewalld:
     when:
       - nfs_group_name is defined
       - nfs_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open rbdmirror ports
     firewalld:
     when:
       - rbdmirror_group_name is defined
       - rbdmirror_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open iscsi target ports
     firewalld:
     when:
       - iscsi_gw_group_name is defined
       - iscsi_gw_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
   - name: open iscsi api ports
     firewalld:
     when:
       - iscsi_gw_group_name is defined
       - iscsi_gw_group_name in group_names
-    tags:
-      - firewall
+    tags: firewall
 
 - meta: flush_handlers
index 485da72accfa6a78fdafaa6615ad87d5b43f796a..7313b7b48e6d7a9c5c8bfe4b388301684ccf150d 100644 (file)
@@ -10,8 +10,7 @@
         state: present
       register: result
       until: result is succeeded
-      when:
-        - ntp_daemon_type == "ntpd"
+      when: ntp_daemon_type == "ntpd"
 
     - name: install chrony
       package:
@@ -19,8 +18,7 @@
         state: present
       register: result
       until: result is succeeded
-      when:
-        - ntp_daemon_type == "chronyd"
+      when: ntp_daemon_type == "chronyd"
 
 - name: enable the ntp daemon and disable the rest
   block:
       notify:
         - disable ntpd
         - disable chronyd
-      when:
-        - ntp_daemon_type == "timesyncd"
+      when: ntp_daemon_type == "timesyncd"
 
     - name: disable time sync using timesyncd if we are not using it
       command: timedatectl set-ntp no
-      when:
-        - ntp_daemon_type != "timesyncd"
+      when: ntp_daemon_type != "timesyncd"
 
     - name: enable ntpd
       service:
@@ -45,8 +41,7 @@
       notify:
         - disable chronyd
         - disable timesyncd
-      when:
-        - ntp_daemon_type == "ntpd"
+      when: ntp_daemon_type == "ntpd"
 
     - name: enable chronyd
       service:
@@ -56,5 +51,4 @@
       notify:
         - disable ntpd
         - disable timesyncd
-      when:
-        - ntp_daemon_type == "chronyd"
+      when: ntp_daemon_type == "chronyd"
index 2c278b30950bcf2fdc7ede3dfb2d5f5d9f61f648..ce46d89dd027b77029c62e264652cc72870fd648 100644 (file)
@@ -2,8 +2,7 @@
 - name: make sure gateway_ip_list is configured
   fail:
     msg: "you must set a list of IPs (comma separated) for gateway_ip_list"
-  when:
-    - gateway_ip_list == "0.0.0.0"
+  when: gateway_ip_list == "0.0.0.0"
 
 - name: copy admin key
   copy:
@@ -12,8 +11,7 @@
     owner: "root"
     group: "root"
     mode: "{{ ceph_keyring_permissions }}"
-  when:
-    - cephx
+  when: cephx
 
 - name: deploy gateway settings, used by the ceph_iscsi_config modules
   template:
@@ -44,5 +42,4 @@
       command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set rbd size {{ rbd_pool_size | default(osd_pool_default_size) }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       changed_when: false
-      when:
-        - rbd_pool_size | default(osd_pool_default_size) != ceph_osd_pool_default_size
+      when: rbd_pool_size | default(osd_pool_default_size) != ceph_osd_pool_default_size
index 7610d2bde06aac30af2f8e1285a0e6cb18b104f8..5b38d2f03ca0c814a5932092ba9c2ddc4d1bbe18 100644 (file)
@@ -11,8 +11,7 @@
     - tcmu-runner
     - rbd-target-gw
     - rbd-target-api
-  notify:
-    - restart ceph {{ item }}
+  notify: restart ceph {{ item }}
 
 - name: systemd start tcmu-runner, rbd-target-api and rbd-target-gw containers
   systemd:
index f8beb519c725293fdb5cd4ff28803b41009d4a75..f4ebd1bc58ed308aa78f3332fbf9faeeb52a7bc3 100644 (file)
@@ -26,8 +26,7 @@
   become: False
   run_once: True
   with_items: "{{ crt_files_exist.results }}"
-  when:
-    - not item.stat.exists
+  when: not item.stat.exists
 
 - name: create pem
   shell: >
@@ -38,8 +37,7 @@
   run_once: True
   register: pem
   with_items: "{{ crt_files_exist.results }}"
-  when:
-    - not item.stat.exists
+  when: not item.stat.exists
 
 - name: create public key from pem
   shell: >
   delegate_to: localhost
   become: False
   run_once: True
-  when:
-    - pem.changed
-  tags:
-    - skip_ansible_lint
+  when: pem.changed
+  tags: skip_ansible_lint
 
 - name: copy crt file(s) to gateway nodes
   copy:
index 77cfe618e19ff633974aebcd46b75f78ace1eabf..f93ece72918d5be27e6d8c3c75b238684e0f5bac 100644 (file)
@@ -4,23 +4,19 @@
 
 - name: include non-container/prerequisites.yml
   include_tasks: non-container/prerequisites.yml
-  when:
-    - not containerized_deployment
+  when: not containerized_deployment
 
 # 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
 
 - name: include containerized.yml
   include_tasks: container/containerized.yml
-  when:
-    - containerized_deployment
+  when: containerized_deployment
index e0dbaf9371fc958d607cb6dcf5faea5f88670dd5..dc78b178a9fa68e30b4e0048fd2a468af42b278d 100644 (file)
@@ -1,7 +1,6 @@
 ---
 - name: red hat based systems tasks
-  when:
-    - ansible_os_family == 'RedHat'
+  when: ansible_os_family == 'RedHat'
   block:
     - name: when ceph_iscsi_config_dev is true
       when:
index c59ceb14ca77eec0e3b1fc75adb99094e1881c3d..f8e220482ded13a23673ce3f50aa6eaa5d29a8ad 100644 (file)
@@ -7,8 +7,7 @@
   set_fact:
     admin_keyring:
       - "/etc/ceph/{{ cluster }}.client.admin.keyring"
-  when:
-    - copy_admin_key
+  when: copy_admin_key
 
 - name: set_fact ceph_config_keys
   set_fact:
@@ -18,8 +17,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
 
 - name: stat for ceph config and keys
   stat:
@@ -53,8 +51,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  notify:
-    - restart ceph mdss
+  notify: restart ceph mdss
 
 - name: systemd start mds container
   systemd:
index 8e0aa2c6facd86d76a5f3d3891619226e889491f..d87d343ea04241014799e4ccf26ba4b88b825eca 100644 (file)
       command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} size {{ item.size | default(osd_pool_default_size) }}"
       with_items: "{{ cephfs_pools | unique }}"
       changed_when: false
-      when:
-        - item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
+      when: item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
 
     - name: customize pool min_size
       command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} min_size {{ item.min_size | default(osd_pool_default_min_size) }}"
       with_items: "{{ cephfs_pools | unique }}"
       changed_when: false
-      when:
-        - (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
+      when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
 
 - name: check if ceph filesystem already exists
   command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} fs get {{ cephfs }}"
@@ -61,8 +59,7 @@
   command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata }} {{ cephfs_data }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when:
-    - check_existing_cephfs.rc != 0
+  when: check_existing_cephfs.rc != 0
 
 - name: assign application to cephfs pools
   command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item }} cephfs"
     - "{{ cephfs_metadata }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when:
-    - check_existing_cephfs.rc != 0
+  when: check_existing_cephfs.rc != 0
 
 - name: set max_mds
   command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when:
-    - mds_max_mds > 1
+  when: mds_max_mds > 1
index 9d19a59db0d50d8dc4d002088de8c6e34f07a336..c7a6f4bfa7bd2b8635f163f87192e1457e65394a 100644 (file)
@@ -8,8 +8,7 @@
 - name: set_fact docker_exec_cmd
   set_fact:
     docker_exec_cmd: "{{ container_binary }} exec ceph-mds-{{ ansible_hostname }}"
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: include common.yml
   include_tasks: common.yml
index 49907acae8db2191e04179d6feaa768f8050693a..d933a3e3d809d22a932bbb8fb5c81bc041a5adc7 100644 (file)
@@ -24,8 +24,7 @@
   environment:
     CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment 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)"
+  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)"
 
 - name: copy ceph keyring(s) if needed
   copy:
@@ -48,5 +47,4 @@
     owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "{{ ceph_keyring_permissions }}"
-  when:
-    - cephx
\ No newline at end of file
+  when: cephx
index 6a92a266309b53b91e3cf3bacd7e19aedbe9e50b..1acda2f56dbe997ef877531edddc4f81f6189443 100644 (file)
@@ -2,8 +2,7 @@
 - name: set_fact docker_exec_cmd
   set_fact:
     docker_exec_cmd_mgr: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: include common.yml
   include_tasks: common.yml
@@ -20,4 +19,4 @@
   when:
     - ceph_mgr_modules | length > 0
     - ((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))
\ No newline at end of file
+      (groups[mgr_group_name] | default([]) | length > 0 and inventory_hostname == groups[mgr_group_name] | last))
index e9ee82087a0f2f3df7eb4e681be6293def2ba58d..057e517c35d4c3ae38314690040ca246702e95a9 100644 (file)
   command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} mgr module disable {{ item }}"
   with_items: "{{ _ceph_mgr_modules.get('enabled_modules', []) }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when:
-    - item not in ceph_mgr_modules
+  when: item not in ceph_mgr_modules
 
 - name: add modules to ceph-mgr
   command: "{{ docker_exec_cmd_mgr | default('') }} ceph --cluster {{ cluster }} mgr module enable {{ item }}"
   with_items: "{{ ceph_mgr_modules }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when:
-    - (item in _disabled_ceph_mgr_modules or _disabled_ceph_mgr_modules == [])
\ No newline at end of file
+  when: (item in _disabled_ceph_mgr_modules or _disabled_ceph_mgr_modules == [])
index 1dcd7c43b3408a6687ce0436cdef2c5984bb0fdf..81bc623fa7b79b756d7418fced52f27447745d8e 100644 (file)
@@ -5,8 +5,7 @@
     state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
   register: result
   until: result is succeeded
-  when:
-    - ansible_os_family in ['RedHat', 'Suse']
+  when: ansible_os_family in ['RedHat', 'Suse']
 
 - name: install ceph-mgr packages for debian
   apt:
@@ -15,5 +14,4 @@
     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 '' }}"
   register: result
   until: result is succeeded
-  when:
-    - ansible_os_family == 'Debian'
+  when: ansible_os_family == 'Debian'
index 3d7fa36256580d5b181def99b7a3f4472d301909..8500651c94e6ab25a735e204f9627211d9ab6183 100644 (file)
     owner: "root"
     group: "root"
     mode: "0644"
-  when:
-    - containerized_deployment
-  notify:
-    - restart ceph mgrs
+  when: containerized_deployment
+  notify: restart ceph mgrs
 
 - name: systemd start mgr
   systemd:
index 4be3721c8bd000b384c4b8f95b51d66db7600818..2bacbebf94b3f9099d763eaf19140e5ce5ff6377 100644 (file)
@@ -17,8 +17,7 @@
   changed_when: false
 
 - name: tasks for MONs when cephx is enabled
-  when:
-    - cephx
+  when: cephx
   block:
   - name: fetch ceph initial keys
     ceph_key:
@@ -48,8 +47,7 @@
     environment:
       CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else None }}"
       CEPH_CONTAINER_BINARY: "{{ container_binary }}"
-    with_items:
-      - "{{ groups.get(mon_group_name) if groups.get(mgr_group_name, []) | length == 0 else groups.get(mgr_group_name, []) }}"
+    with_items: "{{ groups.get(mon_group_name) if groups.get(mgr_group_name, []) | length == 0 else groups.get(mgr_group_name, []) }}"
     run_once: True
     delegate_to: "{{ groups[mon_group_name][0] }}"
 
@@ -58,8 +56,7 @@
       src: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
       dest: "{{ fetch_directory }}/{{ fsid }}/{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
       flat: yes
-    with_items:
-      - "{{ groups.get(mon_group_name) if groups.get(mgr_group_name, []) | length == 0 else groups.get(mgr_group_name, []) }}"
+    with_items: "{{ groups.get(mon_group_name) if groups.get(mgr_group_name, []) | length == 0 else groups.get(mgr_group_name, []) }}"
     delegate_to: "{{ groups[mon_group_name][0] }}"
 
   - name: copy keys to the ansible server
@@ -74,5 +71,4 @@
       - /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring
       - /var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring
       - /etc/ceph/{{ cluster }}.client.admin.keyring
-    when:
-      - inventory_hostname == groups[mon_group_name] | last
+    when: inventory_hostname == groups[mon_group_name] | last
index 18428ecddd7a198ed5b66d6d6b3734a96014f083..adeb769c53bf121b90aeff5c61e4f5716b2e0377 100644 (file)
@@ -15,8 +15,7 @@
   command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} osd crush rule create-simple {{ item.name }} {{ item.root }} {{ item.type }}"
   with_items: "{{ crush_rules | unique }}"
   changed_when: false
-  when:
-    - inventory_hostname == groups.get(mon_group_name) | last
+  when: inventory_hostname == groups.get(mon_group_name) | last
 
 - name: get id for new default crush rule
   command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} osd -f json crush rule dump {{ item.name }}"
index 4c027ea7bba2486e6737ce7b464ae13e079addf2..a25eb60c43d39563a667965429e503a2f6ff8123 100644 (file)
     --keyring /var/lib/ceph/tmp/{{ cluster }}.mon..keyring
   args:
     creates: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
-  when:
-    - cephx
+  when: cephx
 
 - 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
index 893f9ff5771ed6c6a37da070500e37797b8435eb..f8b6ef3f21b312b2c1cddbd15962e100cf0916e6 100644 (file)
@@ -2,8 +2,7 @@
 - name: set_fact docker_exec_cmd
   set_fact:
     docker_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ ansible_hostname }}"
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: include deploy_monitors.yml
   include_tasks: deploy_monitors.yml
@@ -17,8 +16,7 @@
 
 - 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)
 
 - name: include secure_cluster.yml
   include_tasks: secure_cluster.yml
@@ -28,5 +26,5 @@
 
 - name: crush_rules.yml
   include_tasks: crush_rules.yml
-  when:
-    - crush_rule_config
+  when: crush_rule_config
+
index b1be39945c29471aed25f7d34f8126f6d2df4494..f3ceadcabdd8c502036df85d754a6dd16fc6afce 100644 (file)
@@ -27,8 +27,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  notify:
-    - restart ceph mons
+  notify: restart ceph mons
   when: containerized_deployment
 
 - name: start the monitor service
index 6f48c411f3dc7d5568b0c451bcd4eca1dd21c262..c0b5a2e13671d7146e5da1b3c17b9f06a305a827 100644 (file)
@@ -2,8 +2,7 @@
 - name: set_fact docker_exec_cmd_nfs
   set_fact:
     docker_exec_cmd_nfs: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: check if "{{ ceph_nfs_rgw_user }}" exists
   command: "{{ docker_exec_cmd_nfs | default('') }} radosgw-admin --cluster {{ cluster }} user info --uid={{ ceph_nfs_rgw_user }}"
@@ -12,8 +11,7 @@
   changed_when: false
   failed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
-  when:
-    - nfs_obj_gw
+  when: nfs_obj_gw
 
 - name: create rgw nfs user "{{ ceph_nfs_rgw_user }}"
   command: "{{ docker_exec_cmd_nfs | default('') }} radosgw-admin --cluster {{ cluster }} user create --uid={{ ceph_nfs_rgw_user }} --display-name='RGW NFS User'"
index 1c3c0ba7de820309df42743edc0461cc20a24b43..b07b7c06e575f5aefe5c09ce5c2663cb1524a2bb 100644 (file)
@@ -12,8 +12,7 @@
     state: present
   register: result
   until: result is succeeded
-  when:
-    - selinuxstatus.stdout != 'Disabled'
+  when: selinuxstatus.stdout != 'Disabled'
 
 - name: test if ganesha_t is already permissive
   shell: |
index b68eb26a1f71cf4d65316efb1d630248c266f300..6e009948218c606a67777dd9d8d1bc19ab6bd2a3 100644 (file)
@@ -2,21 +2,18 @@
 - name: set_fact docker_exec_cmd
   set_fact:
     docker_exec_cmd: "{{ container_binary }} exec ceph-nfs-{{ ansible_hostname }}"
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - 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
 
 - name: include pre_requisite_container.yml
   include_tasks: pre_requisite_container.yml
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: include create_rgw_nfs_user.yml
   import_tasks: create_rgw_nfs_user.yml
index 1f2e02a963834b25db0ee2bde640563d56d03046..5206c128525f165ddf8f8dfa00feb46d3158ee82 100644 (file)
@@ -3,8 +3,7 @@
   set_fact:
     admin_keyring:
       - "/etc/ceph/{{ cluster }}.client.admin.keyring"
-  when:
-    - copy_admin_key
+  when: copy_admin_key
 
 - name: set_fact ceph_config_keys
   set_fact:
@@ -14,8 +13,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
 
 - name: stat for config and keys
   stat:
@@ -39,8 +37,7 @@
   with_together:
     - "{{ ceph_config_keys }}"
     - "{{ statconfig.results }}"
-  when:
-    - item.1.stat.exists
+  when: item.1.stat.exists
 
 - name: create dbus service file
   become: true
     owner: "root"
     group: "root"
     mode: "0644"
-  when:
-    - ceph_nfs_dynamic_exports
+  when: ceph_nfs_dynamic_exports
 
 - name: reload dbus configuration
   command: "killall -SIGHUP dbus-daemon"
-  when:
-    - ceph_nfs_dynamic_exports
+  when: ceph_nfs_dynamic_exports
index 9b00c1377947e4c1fc6504714cb4e6a8ea5d6023..5b5fb70560d09971de2f7d6202cb9b6590051925 100644 (file)
@@ -1,13 +1,11 @@
 ---
 - name: include red hat based system related tasks
   include_tasks: pre_requisite_non_container_red_hat.yml
-  when:
-    - ansible_os_family == 'RedHat'
+  when: ansible_os_family == 'RedHat'
 
 - name: include debian based system related tasks
   include_tasks: pre_requisite_non_container_debian.yml
-  when:
-    - ansible_os_family == 'Debian'
+  when: ansible_os_family == 'Debian'
 
 - name: install nfs rgw/cephfs gateway - suse
   zypper:
     - { 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
+  when: cephx
   block:
     - name: copy bootstrap cephx keys
       copy:
         owner: "ceph"
         group: "ceph"
         mode: "0600"
-      with_items:
-        - { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: "{{ nfs_obj_gw }}" }
-      when:
-        - item.copy_key|bool
+      with_items: { name: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: "{{ nfs_obj_gw }}" }
+      when: item.copy_key|bool
 
     - name: nfs object gateway related tasks
-      when:
-        - nfs_obj_gw
+      when: nfs_obj_gw
       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 6c9e8d18df7a900ee9ea1712b9d8d72c82d600ed..db718f308ac36df1eb264abbe687e1ebaf11ab2e 100644 (file)
@@ -1,11 +1,9 @@
 ---
 - name: debian based systems - repo handling
-  when:
-    - ceph_origin == 'repository'
+  when: ceph_origin == 'repository'
   block:
     - name: stable repos specific tasks
-      when:
-        - nfs_ganesha_stable
+      when: nfs_ganesha_stable
         - ceph_repository == 'community'
       block:
         - name: add nfs-ganesha stable repository
@@ -22,8 +20,7 @@
           retries: 5
           delay: 2
           until: update_ganesha_apt_cache | success
-          when:
-            - add_ganesha_apt_repo | changed
+          when: add_ganesha_apt_repo | changed
 
     - name: debian based systems - dev repos specific tasks
       when:
             state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
           register: result
           until: result is succeeded
-          when:
-            - nfs_file_gw
+          when: nfs_file_gw
         - 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
index 719812bedc2bb2a3e06fe672ad38ae4a817805c8..8d80a036b379579ca04716eedd5cdb0b20dafd7a 100644 (file)
@@ -1,7 +1,6 @@
 ---
 - name: red hat based systems - repo handling
-  when:
-    - ceph_origin == 'repository'
+  when: ceph_origin == 'repository'
   block:
     - name: add nfs-ganesha stable repository
       yum_repository:
@@ -42,8 +41,7 @@
         state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
       register: result
       until: result is succeeded
-      when:
-        - nfs_file_gw
+      when: nfs_file_gw
 
     - name: install redhat nfs-ganesha-rgw and ceph-radosgw packages
       package:
@@ -51,5 +49,4 @@
         state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
       register: result
       until: result is succeeded
-      when:
-        - nfs_obj_gw
+      when: nfs_obj_gw
index 6536881ea12df4cb3ffbac4c65067b9861bccc42..9ea501a0e002d2e27699c1a5a45613f3396ba552 100644 (file)
@@ -2,8 +2,7 @@
 - name: set_fact docker_exec_cmd_nfs
   set_fact:
     docker_exec_cmd_nfs: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: check if rados index object exists
   shell: "{{ docker_exec_cmd_nfs | default('') }} rados -p {{ cephfs_data }} --cluster {{ cluster }} ls|grep {{ ceph_nfs_rados_export_index }}"
@@ -11,8 +10,7 @@
   failed_when: false
   register: rados_index_exists
   check_mode: no
-  when:
-    - ceph_nfs_rados_backend
+  when: ceph_nfs_rados_backend
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
 
@@ -41,8 +39,7 @@
     group: "root"
     mode: "0644"
     config_type: ini
-  notify:
-    - restart ceph nfss
+  notify: restart ceph nfss
 
 - name: create exports directory
   file:
@@ -51,8 +48,7 @@
     owner: "root"
     group: "root"
     mode: "0755"
-  when:
-    - ceph_nfs_dynamic_exports
+  when: ceph_nfs_dynamic_exports
 
 - name: create exports dir index file
   copy:
@@ -62,8 +58,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  when:
-    - ceph_nfs_dynamic_exports
+  when: ceph_nfs_dynamic_exports
 
 - name: generate systemd unit file
   become: true
     owner: "root"
     group: "root"
     mode: "0644"
-  when:
-    - containerized_deployment
-  notify:
-    - restart ceph nfss
+  when: containerized_deployment
+  notify: restart ceph nfss
 
 - name: systemd start nfs container
   systemd:
index daf1f4819a465153934983c88743363dbeb1b186..2d5ff45ce0e20ee659c934ff18dcdcbe0554256e 100644 (file)
@@ -6,8 +6,7 @@
     owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "0755"
-  when:
-    - cephx
+  when: cephx
   with_items:
     - /var/lib/ceph/bootstrap-osd/
     - /var/lib/ceph/osd/
index 9ce5b7616ccb842c7ab7d804970c79ee81b1be43..f8818d1d98ad63a980ad1b4b45bef1f8213f5a8e 100644 (file)
   when:
     - containerized_deployment
     - ceph_osd_numactl_opts != ""
-  tags:
-    - with_pkg
+  tags: with_pkg
 
 - name: install lvm2
   package:
     name: lvm2
   register: result
   until: result is succeeded
-  when:
-    - not is_atomic
-  tags:
-    - with_pkg
+  when: not is_atomic
+  tags: with_pkg
 
 - name: include_tasks common.yml
   include_tasks: common.yml
index 2fa2f79bed30ac614589caaaa814be5e320ba102..ba8682d3730407b95976beba870c75caf6496c53 100644 (file)
@@ -39,8 +39,7 @@
         - "{{ created_pools.results }}"
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"
-      when:
-        - item.1.get('rc', 0) != 0
+      when: item.1.get('rc', 0) != 0
 
     - name: customize pool size
       command: >
@@ -49,8 +48,7 @@
       with_items: "{{ openstack_pools | unique }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       changed_when: false
-      when:
-        - item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
+      when: item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
 
     - name: customize pool min_size
       command: >
       with_items: "{{ openstack_pools | unique }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       changed_when: false
-      when:
-        - (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
+      when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
 
     - name: assign application to pool(s)
       command: "{{ hostvars[groups[mon_group_name][0]]['docker_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"
       with_items: "{{ openstack_pools | unique }}"
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"
-      when:
-        - item.application is defined
+      when: item.application is defined
 
 - name: create openstack cephx key(s)
   ceph_key:
   when:
     - cephx
     - openstack_config
-    - item.0 != groups[mon_group_name]
\ No newline at end of file
+    - item.0 != groups[mon_group_name]
index 27b357b7ff2a3250e839a6e797c8a96377058006..a9e0fb85b5a94185d8fd7e3b5b45fcd956ecb3ce 100644 (file)
@@ -1,7 +1,6 @@
 ---
 - name: container specific tasks
-  when:
-    - containerized_deployment
+  when: containerized_deployment
   block:
   - name: umount ceph disk (if on openstack)
     mount:
@@ -9,8 +8,7 @@
       src: /dev/vdb
       fstype: ext3
       state: unmounted
-    when:
-      - ceph_docker_on_openstack
+    when: ceph_docker_on_openstack
 
   - name: generate ceph osd docker run script
     become: true
@@ -21,8 +19,7 @@
       group: "root"
       mode: "0744"
       setype: "bin_t"
-    notify:
-      - restart ceph osds
+    notify: restart ceph osds
 
 # this is for ceph-disk, the ceph-disk command is gone so we have to list /var/lib/ceph
 - name: get osd ids
     owner: "root"
     group: "root"
     mode: "0644"
-  notify:
-    - restart ceph osds
-  when:
-    - containerized_deployment
+  notify: restart ceph osds
+  when: containerized_deployment
 
 - name: systemd start osd
   systemd:
index 6a825fd61663a6dc359268d6e520064c8e1434ba..4087317be6f7e78f5720dcec63831bf61706b8a4 100644 (file)
@@ -23,8 +23,7 @@
     group: "root"
     mode: "0755"
   register: "tmpfiles_d"
-  when:
-    - disable_transparent_hugepage
+  when: disable_transparent_hugepage
 
 - name: disable transparent hugepage
   template:
@@ -35,8 +34,7 @@
     mode: "0644"
     force: "yes"
     validate: "systemd-tmpfiles --create %s"
-  when:
-    - disable_transparent_hugepage
+  when: disable_transparent_hugepage
 
 - name: get default vm.min_free_kbytes
   command: sysctl -b vm.min_free_kbytes
index a48a40eeb8aa20dfc42d4fcf2233bb42f9a5fc6a..a9a7e32c0f561fe5154823bf8df82f6069997b73 100644 (file)
@@ -18,8 +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
 
 - name: set rbd-mirror key permissions
   file:
@@ -27,5 +26,4 @@
     owner: "ceph"
     group: "ceph"
     mode: "{{ ceph_keyring_permissions }}"
-  when:
-    - not containerized_deployment
\ No newline at end of file
+  when: not containerized_deployment
index 68432bd1dd35bc432543b4f5f27beb35103dc039..d863127e27d787e3542dd55f1744e1761d3a4616 100644 (file)
@@ -8,8 +8,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  notify:
-    - restart ceph rbdmirrors
+  notify: restart ceph rbdmirrors
 
 - name: systemd start rbd mirror container
   systemd:
index 7b8036cfb39b68976f86d7c078537df5c262316f..22480c0bbfab2daab9150d1559a2e99dd1fc3cbd 100644 (file)
@@ -2,23 +2,19 @@
 - name: set_fact docker_exec_cmd
   set_fact:
     docker_exec_cmd: "{{ container_binary }} exec ceph-rbd-mirror-{{ ansible_hostname }}"
-  when:
-    - containerized_deployment
+  when: containerized_deployment
 
 - name: include pre_requisite.yml
   include_tasks: pre_requisite.yml
-  when:
-    - not containerized_deployment
+  when: not containerized_deployment
 
 - name: include common.yml
   include_tasks: common.yml
-  when:
-    - cephx
+  when: cephx
 
 - name: include start_rbd_mirror.yml
   include_tasks: start_rbd_mirror.yml
-  when:
-    - not containerized_deployment
+  when: not containerized_deployment
 
 - name: include configure_mirroring.yml
   include_tasks: configure_mirroring.yml
@@ -28,5 +24,4 @@
 
 - name: include docker/main.yml
   include_tasks: docker/main.yml
-  when:
-    - containerized_deployment
+  when: containerized_deployment
index 7a97097a356de0e25dcaa214f3535b0fcc8ec3f4..09b27aa56b7a04dc4632dfb6957ca25f7e731ee2 100644 (file)
@@ -7,5 +7,4 @@
     state: present
   register: result
   until: result is succeeded
-  tags:
-    - package-install
\ No newline at end of file
+  tags: package-install
index 268a0c0bb18363863fb148937f3404c00226c8d8..b40573e84a9d33ed85069746bc97a38dcc0678b5 100644 (file)
@@ -6,8 +6,7 @@
     owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "0755"
-  with_items:
-    - "{{ rbd_client_admin_socket_path }}"
+  with_items: "{{ rbd_client_admin_socket_path }}"
 
 - name: create rados gateway instance directories
   file:
@@ -17,8 +16,7 @@
     group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
     mode: "0755"
   with_items: "{{ rgw_instances }}"
-  when:
-    - rgw_instances is defined
+  when: rgw_instances is defined
 
 - name: copy ceph keyring(s) if needed
   copy:
index e48d0b9066d91e058ebb25e2b46e7d3d5e45ed96..ddc2624363a205bf53f37610dbb3924cb948b83e 100644 (file)
@@ -19,8 +19,7 @@
     owner: "root"
     group: "root"
     mode: "0644"
-  notify:
-    - restart ceph rgws
+  notify: restart ceph rgws
 
 - name: systemd start rgw container
   systemd:
index c785aff83c4b1a5225220249ddc286a1aaf7d59f..43248517cdc60031161a362fdfbe1ea73637d013 100644 (file)
@@ -23,8 +23,7 @@
   when: rgw_multisite
 
 - name: rgw pool related tasks
-  when:
-    - rgw_create_pools is defined
+  when: rgw_create_pools is defined
   block:
     - name: create rgw pools if rgw_create_pools is defined
       command: "{{ docker_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool create {{ item.key }} {{ item.value.pg_num | default(osd_pool_default_pg_num) }}"
@@ -43,5 +42,4 @@
       run_once: true
       register: result
       until: result is succeeded
-      when:
-        - item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
+      when: item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
index 82342e269950ed2b26f8f28040d5b0fd1b8b7192..aac0e86bc0b82efcab3632ae679813f38dffa9a5 100644 (file)
@@ -12,8 +12,7 @@
   failed_when: false
   register: rgw_remove_zone_from_zonegroup
   changed_when: rgw_remove_zone_from_zonegroup.rc == 0
-  notify:
-    - update period
+  notify: update period
 
 - name: delete the zone
   command: radosgw-admin zone delete --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }}
@@ -44,5 +43,4 @@
   when:
     - rgw_zone is defined
     - rgw_zonegroup is defined
-  notify:
-    - restart rgw
+  notify: restart rgw
index 93a08e677c04acdcd383364a08e8cdd67ae20fa2..40b884f8d10dbfe0a9042ef8638ae04555a8d94c 100644 (file)
@@ -22,5 +22,4 @@
     section: "client.rgw.{{ ansible_hostname }}"
     option: "rgw_zone"
     value: "{{ rgw_zone }}"
-  notify:
-    - restart rgw
+  notify: restart rgw
index 26449f3f33bddf588a4700a984fa5b23c082a157..5c1836ece9d52d485d182bb92f76725ca3fd8b3f 100644 (file)
@@ -3,37 +3,30 @@
   command: "{{ docker_exec_cmd }} radosgw-admin realm create --rgw-realm={{ rgw_realm }} --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - "'No such file or directory' in realmcheck.stderr"
+  when: "'No such file or directory' in realmcheck.stderr"
 
 - name: create the zonegroup
   command: "{{ docker_exec_cmd }} radosgw-admin zonegroup create --rgw-zonegroup={{ rgw_zonegroup }} --endpoints={{ rgw_multisite_proto }}://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --master --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - "'No such file or directory' in zonegroupcheck.stderr"
+  when: "'No such file or directory' in zonegroupcheck.stderr"
 
 - name: create the zone
   command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints={{ rgw_multisite_proto }}://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default --master"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - "'No such file or directory' in zonecheck.stderr"
+  when: "'No such file or directory' in zonecheck.stderr"
 
 - name: create the zone user
   command: "{{ docker_exec_cmd }} radosgw-admin user create --uid={{ rgw_zone_user }} --display-name=\"Zone User\" --access-key={{ system_access_key }} --secret={{ system_secret_key }} --system"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - "'could not fetch user info: no user info saved' in usercheck.stderr"
-  notify:
-    - update period
+  when: "'could not fetch user info: no user info saved' in usercheck.stderr"
+  notify: update period
 
 - name: add other endpoints to the zone
   command: "{{ docker_exec_cmd }} radosgw-admin zone modify --rgw-zone={{ rgw_zone }} --endpoints {{ rgw_multisite_endpoints_list }}" 
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - rgw_multisite_endpoints_list is defined
-  notify:
-    - update period
+  when: rgw_multisite_endpoints_list is defined
+  notify: update period
index 24a44cf46bfc80121ccdf1b1cc9beeff53c7595b..53ee83bd911aec9128f774ae8af03b648c2c3f3f 100644 (file)
@@ -3,15 +3,13 @@
   command: "{{ docker_exec_cmd }} radosgw-admin realm pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - "'No such file or directory' in realmcheck.stderr"
+  when: "'No such file or directory' in realmcheck.stderr"
 
 - name: fetch the period
   command: "{{ docker_exec_cmd }} radosgw-admin period pull --url={{ rgw_pull_proto }}://{{ rgw_pullhost }}:{{ rgw_pull_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - "'No such file or directory' in realmcheck.stderr"
+  when: "'No such file or directory' in realmcheck.stderr"
 
 - name: set default realm
   command: "{{ docker_exec_cmd }} radosgw-admin realm default --rgw-realm={{ rgw_realm }}"
   command: "{{ docker_exec_cmd }} radosgw-admin zone create --rgw-zonegroup={{ rgw_zonegroup }} --rgw-zone={{ rgw_zone }} --endpoints={{ rgw_multisite_proto }}://{{ rgw_multisite_endpoint_addr }}:{{ radosgw_frontend_port }} --access-key={{ system_access_key }} --secret={{ system_secret_key }} --default"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - "'No such file or directory' in zonecheck.stderr"
-  notify:
-    - update period
+  when: "'No such file or directory' in zonecheck.stderr"
+  notify: update period
 
 - name: add other endpoints to the zone
   command: "{{ docker_exec_cmd }} radosgw-admin zone modify --rgw-zone={{ rgw_zone }} --endpoints {{ rgw_multisite_endpoints_list }}" 
   delegate_to: "{{ groups[mon_group_name][0] }}"
   run_once: true
-  when:
-    - rgw_multisite_endpoints_list is defined
-  notify:
-    - update period
+  when: rgw_multisite_endpoints_list is defined
+  notify: update period
index 2579f1a1981a7a941e76b9d6ae5de4faea270a72..3af8405da5634a3cc320c56ce764aa3d8e3291ea 100644 (file)
@@ -5,8 +5,7 @@
     state: present
   register: result
   until: result is succeeded
-  when:
-    - ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
+  when: ansible_pkg_mgr == 'yum' or ansible_pkg_mgr == 'dnf'
 
 - name: install libnss3-tools on debian
   package:
@@ -14,8 +13,7 @@
     state: present
   register: result
   until: result is succeeded
-  when:
-    - ansible_pkg_mgr == 'apt'
+  when: ansible_pkg_mgr == 'apt'
 
 - name: create nss directory for keystone certificates
   file:
@@ -33,5 +31,4 @@
   with_items:
     - "openssl x509 -in /etc/keystone/ssl/certs/ca.pem -pubkey | certutil -d {{ radosgw_nss_db_path }} -A -n ca -t 'TCu,Cu,Tuw'"
     - "openssl x509 -in /etc/keystone/ssl/certs/signing_cert.pem -pubkey | certutil -A -d {{ radosgw_nss_db_path }} -n signing_cert -t 'P,P,P'"
-  tags:
-    - skip_ansible_lint
+  tags: skip_ansible_lint
index 6219d27990f7b1b2b92d7be9ab53c59a8d47eab3..96d08a18c7ada0820930c15cdc97186f0018db43 100644 (file)
@@ -5,8 +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
 
 - name: set rados gateway instance key permissions
   file:
@@ -15,5 +14,4 @@
     group: "ceph"
     mode: "0600"
   with_items: "{{ rgw_instances }}"
-  when:
-    - cephx
+  when: cephx
index 0419c1247889f242a01521f54cf3bb818c307199..39102e82f5325e93d63d7fe03d14f64ee2adece6 100644 (file)
@@ -3,8 +3,7 @@
   file:
     state: directory
     path: "/etc/systemd/system/ceph-radosgw@.service.d/"
-  when:
-    - ceph_rgw_systemd_overrides is defined
+  when: ceph_rgw_systemd_overrides is defined
 
 - name: add ceph-rgw systemd service overrides
   config_template:
@@ -12,8 +11,7 @@
     dest: "/etc/systemd/system/ceph-radosgw@.service.d/ceph-radosgw-systemd-overrides.conf"
     config_overrides: "{{ ceph_rgw_systemd_overrides | default({}) }}"
     config_type: "ini"
-  when:
-    - ceph_rgw_systemd_overrides is defined
+  when: ceph_rgw_systemd_overrides is defined
 
 - name: start rgw instance
   service:
index ccbf57605cef021b3261456110b960c60e414628..d819ca74ac2256fcdbf356bbfe7e0b97f3d663f2 100644 (file)
@@ -1,7 +1,6 @@
 ---
 - name: devices validation
-  when:
-    - devices is defined
+  when: devices is defined
   block:
     - name: validate devices is actually a device
       parted:
@@ -13,6 +12,5 @@
     - name: fail if one of the devices is not a device
       fail:
         msg: "{{ item }} is not a block special file!"
-      when:
-        - item.failed
+      when: item.failed
       with_items: "{{ devices_parted.results }}"
index ce42be48b553568daceb28f4202c88626131f1cc..5f805473cf824a7085d70141b848ff4229556a19 100644 (file)
@@ -2,14 +2,12 @@
 - name: "fail if {{ monitor_interface }} does not exist on {{ inventory_hostname }}"
   fail:
     msg: "{{ monitor_interface }} does not exist on {{ inventory_hostname }}"
-  when:
-    - monitor_interface not in ansible_interfaces
+  when: monitor_interface not in ansible_interfaces
 
 - name: "fail if {{ monitor_interface }} is not active on {{ inventory_hostname }}"
   fail:
     msg: "{{ monitor_interface }} is not active on {{ inventory_hostname }}"
-  when:
-    - not hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['active']
+  when: not hostvars[inventory_hostname]['ansible_' + (monitor_interface | replace('-', '_'))]['active']
 
 - name: "fail if {{ monitor_interface }} does not have any ip v4 address on {{ inventory_hostname }}"
   fail:
index d9fff48605998077e651b0d30a75d3cd59a6e487..73db6078e2a3ee9c54cd3a07853bd2dc3ea4fa26 100644 (file)
@@ -2,14 +2,12 @@
 - name: "fail if {{ radosgw_interface }} does not exist on {{ inventory_hostname }}"
   fail:
     msg: "{{ radosgw_interface }} does not exist on {{ inventory_hostname }}"
-  when:
-    - radosgw_interface not in ansible_interfaces
+  when: radosgw_interface not in ansible_interfaces
 
 - name: "fail if {{ radosgw_interface }} is not active on {{ inventory_hostname }}"
   fail:
     msg: "{{ radosgw_interface }} is not active on {{ inventory_hostname }}"
-  when:
-    - hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['active'] == "false"
+  when: hostvars[inventory_hostname]['ansible_' + (radosgw_interface | replace('-', '_'))]['active'] == "false"
 
 - name: "fail if {{ radosgw_interface }} does not have any ip v4 address on {{ inventory_hostname }}"
   fail:
index e5cb1074f3ce62af7feaf8ad6778ac5f00bfdb07..59f7426aaf5a069a148681eff00a7447ab3a7984 100644 (file)
@@ -2,5 +2,4 @@
 - name: "fail if {{ inventory_hostname }} does not have any {{ ip_version }} address on {{ monitor_address_block }}"
   fail:
     msg: "{{ inventory_hostname }} does not have any {{ ip_version }} address on {{ monitor_address_block }}"
-  when:
-    - hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(hostvars[inventory_hostname]['monitor_address_block']) | length == 0
+  when: hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(hostvars[inventory_hostname]['monitor_address_block']) | length == 0
index 5041896b7b19c35aef89d24010ba4f16026f5f69..4a538f9a855b0e723a646d9b02c5acceba314720 100644 (file)
@@ -2,20 +2,17 @@
 - name: fail on unsupported system
   fail:
     msg: "System not supported {{ ansible_system }}"
-  when:
-    - ansible_system not in ['Linux']
+  when: ansible_system not in ['Linux']
 
 - name: fail on unsupported architecture
   fail:
     msg: "Architecture not supported {{ ansible_architecture }}"
-  when:
-    - ansible_architecture not in ['x86_64', 'ppc64le', 'armv7l', 'aarch64']
+  when: ansible_architecture not in ['x86_64', 'ppc64le', 'armv7l', 'aarch64']
 
 - name: fail on unsupported distribution
   fail:
     msg: "Distribution not supported {{ ansible_os_family }}"
-  when:
-    - ansible_os_family not in ['Debian', 'RedHat', 'ClearLinux', 'Suse']
+  when: ansible_os_family not in ['Debian', 'RedHat', 'ClearLinux', 'Suse']
 
 - name: red hat based systems tasks
   when:
     - name: fail on unsupported distribution for red hat ceph storage
       fail:
         msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Ceph Storage, only RHEL >= 7.3"
-      when:
-        - ansible_distribution_version | version_compare('7.3', '<')
+      when: ansible_distribution_version | version_compare('7.3', '<')
 
     - name: subscription manager related tasks
-      when:
-        - ceph_repository_type == 'cdn'
+      when: ceph_repository_type == 'cdn'
       block:
         - name: determine if node is registered with subscription-manager
           command: subscription-manager identity
@@ -42,8 +37,7 @@
         - name: fail on unregistered red hat rhcs linux
           fail:
             msg: "You must register your machine with subscription-manager"
-          when:
-            - subscription.rc != '0'
+          when: subscription.rc != '0'
 
 - name: fail on unsupported distribution for ubuntu cloud archive
   fail:
@@ -62,8 +56,7 @@
 - name: fail on unsupported ansible version (1.X)
   fail:
     msg: "Ansible version must be >= 2.7.x, please update!"
-  when:
-    - ansible_version.major|int < 2
+  when: ansible_version.major|int < 2
 
 - name: fail on unsupported ansible version
   fail:
 - name: fail if systemd is not present
   fail:
     msg: "Systemd must be present"
-  when:
-    - ansible_service_mgr != 'systemd'
+  when: ansible_service_mgr != 'systemd'
 
 - name: check if iscsi gateways is target on supported distros and versions
   block:
     - name: fail on unsupported distribution for iscsi gateways
       fail:
         msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux, CentOS or Fedora"
-      when:
-        - ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']
+      when: ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']
 
     - name: fail on unsupported distribution version for iscsi gateways
       fail:
@@ -92,6 +83,5 @@
       when:
         - ansible_distribution_version < '7.4'
         - ansible_distribution in ['RedHat', 'CentOS']
-  when:
-    - iscsi_gw_group_name in group_names
+  when: iscsi_gw_group_name in group_names
 
index 1c3ea4bfce03058141087edf6123ef5e2ae470ed..30bf9969746894ec7bff9281cb13e92adfb5aa0c 100644 (file)
     - not use_fqdn_yes_i_am_sure
 
 - name: debian based systems tasks
-  when:
-    - ansible_os_family == 'Debian'
+  when: ansible_os_family == 'Debian'
   block:
     - name: fail if local scenario is enabled on debian
       fail:
         msg: "'local' installation scenario not supported on Debian systems"
-      when:
-        - ceph_origin == 'local'
+      when: ceph_origin == 'local'
     - name: verify that ceph_rhcs_cdn_debian_repo url is valid for red hat storage
       fail:
         msg: "ceph_rhcs_cdn_debian_repo url is invalid, please set your customername:customerpasswd"
@@ -95,8 +93,7 @@
 
 - name: include check_iscsi.yml
   include_tasks: check_iscsi.yml
-  when:
-    - iscsi_gw_group_name in group_names
+  when: iscsi_gw_group_name in group_names
 
 - name: warn about radosgw_civetweb_num_threads option deprecation
   debug:
index 3e9bab72f6e8717c685558c3f7bd44dfdd7d1d29..58c8263109f01da8976d41bd886e39f4d2584ec6 100644 (file)
@@ -28,8 +28,7 @@
     # pre-tasks for following import -
     - name: gather facts
       setup:
-      when:
-        - not delegate_facts_host | bool
+      when: not delegate_facts_host | bool
 
     - name: gather and delegate facts
       setup:
       delegate_facts: True
       with_items: "{{ groups['all'] }}"
       run_once: true
-      when:
-        - delegate_facts_host | bool
+      when: delegate_facts_host | bool
 
     - name: check if it is atomic host
       stat:
         path: /run/ostree-booted
       register: stat_ostree
-      tags:
-        - always
+      tags: always
 
     - name: set_fact is_atomic
       set_fact:
         is_atomic: '{{ stat_ostree.stat.exists }}'
-      tags:
-        - always
+      tags: always
 
     - name: check if podman binary is present
       stat:
         name: ceph-handler
     - import_role:
         name: ceph-container-common
-      when:
-        - inventory_hostname == groups.get('clients', ['']) | first
+      when: inventory_hostname == groups.get('clients', ['']) | first
     - import_role:
         name: ceph-config
       tags: ['ceph_update_config']
index 2290a3b704dc16358bc45d4d3f3eaffb4fe205fd..9aa1923c831bee2c67aa500cbf1a0de1babf650a 100644 (file)
@@ -18,8 +18,7 @@
   any_errors_fatal: true
   become: true
 
-  tags:
-    - always
+  tags: always
 
   vars:
     delegate_facts_host: True
@@ -32,8 +31,7 @@
 
     - name: gather facts
       setup:
-      when:
-        - not delegate_facts_host | bool
+      when: not delegate_facts_host | bool
 
     - name: gather and delegate facts
       setup:
@@ -41,8 +39,7 @@
       delegate_facts: True
       with_items: "{{ groups['all'] }}"
       run_once: true
-      when:
-        - delegate_facts_host | bool
+      when: delegate_facts_host | bool
 
     - name: install required packages for fedora > 23
       raw: sudo dnf -y install python2-dnf libselinux-python ntp
       stat:
         path: /run/ostree-booted
       register: stat_ostree
-      tags:
-        - always
+      tags: always
 
     - name: set_fact is_atomic
       set_fact:
         is_atomic: '{{ stat_ostree.stat.exists }}'
-      tags:
-        - always
+      tags: always
 
   tasks:
     - import_role:
index 30136eb2f554654294734172b11fd809dcf6f92b..d75a6e5ab3f36b82d272230f2eb6c8b2debb8304 100644 (file)
@@ -2,8 +2,7 @@
 - hosts: localhost
   gather_facts: false
   become: no
-  tags:
-    - vagrant_setup
+  tags: vagrant_setup
   tasks:
 
 
@@ -32,4 +31,4 @@
 
       - name: print contents of {{ group_vars_path }}
         command: "cat {{ group_vars_path }}"
-      when: dev_setup
\ No newline at end of file
+      when: dev_setup
index 2505079834f417d245827bf0ecd6ba48b64eddf6..e6deb9d8f679dbe46b0dc6deece54e2bcb610487 100644 (file)
       stat:
         path: /run/ostree-booted
       register: stat_ostree
-      tags:
-        - always
+      tags: always
     - name: set_fact is_atomic
       set_fact:
         is_atomic: '{{ stat_ostree.stat.exists }}'
-      tags:
-        - always
+      tags: always
     # Some images may not have lvm2 installed
     - name: install lvm2
       package:
@@ -27,8 +25,7 @@
         state: present
       register: result
       until: result is succeeded
-      when:
-        - not is_atomic
+      when: not is_atomic
     - name: create physical volume
       command: pvcreate /dev/sdb
       failed_when: false
index 45502c5608dffd1a473173750df16fa1c5d8c88f..b354f9ac0ae8c1df82c87ba5a380bc9201b686e8 100644 (file)
@@ -21,8 +21,7 @@
         state: present
       register: result
       until: result is succeeded
-      when:
-        - not is_atomic
+      when: not is_atomic
 
     - name: generate and upload a random 10Mb file - containerized deployment
       command: >
index abbb4030f65d1d4b79f8e40d4ad0cb1aea906fe3..a7b87aecbe4dc786c1193fb250c3cde5ed4c9205 100644 (file)
@@ -2,8 +2,7 @@
 - hosts: localhost
   gather_facts: false
   become: yes
-  tags:
-    - vagrant_setup
+  tags: vagrant_setup
   tasks:
 
     - name: change centos/7 vagrant box name to rhel7
         baseurl: "{{ repo_url }}/MON/x86_64/os/"
         gpgcheck: no
         enabled: yes
-      when:
-        - not is_atomic
+      when: not is_atomic
 
 - hosts: osds
   gather_facts: false
         baseurl: "{{ repo_url }}/OSD/x86_64/os/"
         gpgcheck: no
         enabled: yes
-      when:
-        - not is_atomic
+      when: not is_atomic
 
     - 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
index 91eddb870f4c77dea85aaa498328ce9fde90257a..9648a57b240c0756c00f42fae611abb0c88751f1 100644 (file)
@@ -36,8 +36,7 @@
         state: present
       register: result
       until: result is succeeded
-      when:
-        - not is_atomic
+      when: not is_atomic
 
     - name: centos based systems - configure repos
       block: