playbook: remove jinja syntax in when statement

this syntax in deprecated

Closes: #3281

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/3285/head
Guillaume Abrioux 2018-10-29 20:28:29 +01:00 committed by Sébastien Han
parent 9f62bb6f1d
commit f7d4651186
4 changed files with 9 additions and 9 deletions

View File

@ -312,23 +312,23 @@
- name: wipe table on dm-crypt devices
command: dmsetup wipe_table --force "{{ item }}"
with_items: "{{ encrypted_ceph_partuuid.stdout_lines }}"
when: "{{ encrypted_ceph_partuuid.stdout_lines | length > 0 }}"
when: encrypted_ceph_partuuid.stdout_lines | length > 0
- name: delete dm-crypt devices if any
command: dmsetup remove --retry --force {{ item }}
with_items: "{{ encrypted_ceph_partuuid.stdout_lines }}"
when: "{{ encrypted_ceph_partuuid.stdout_lines | length > 0 }}"
when: encrypted_ceph_partuuid.stdout_lines | length > 0
- name: get payload_offset
shell: cryptsetup luksDump /dev/disk/by-partuuid/{{ item }} | awk '/Payload offset:/ { print $3 }'
register: payload_offset
with_items: "{{ encrypted_ceph_partuuid.stdout_lines }}"
when: "{{ encrypted_ceph_partuuid.stdout_lines | length > 0 }}"
when: encrypted_ceph_partuuid.stdout_lines | length > 0
- name: get physical sector size
command: blockdev --getpbsz /dev/disk/by-partuuid/{{ item }}
with_items: "{{ encrypted_ceph_partuuid.stdout_lines }}"
when: "{{ encrypted_ceph_partuuid.stdout_lines | length > 0 }}"
when: encrypted_ceph_partuuid.stdout_lines | length > 0
register: phys_sector_size
- name: wipe dmcrypt device

View File

@ -90,7 +90,7 @@
when:
- cephx
- containerized_deployment
- "{{ groups.get(mgr_group_name, []) | length > 0 }}"
- groups.get(mgr_group_name, []) | length > 0
- not containerized_deployment_with_kv
with_items: "{{ groups.get(mgr_group_name, []) }}"
@ -102,7 +102,7 @@
with_items:
- "{{ groups.get(mgr_group_name, []) }}"
when:
- "{{ groups.get(mgr_group_name, []) | length > 0 }}"
- groups.get(mgr_group_name, []) | length > 0
when:
- not rolling_update

View File

@ -11,7 +11,7 @@
KV_PORT: "{{kv_port}}"
run_once: true
when:
- "{{ inventory_hostname == groups[mon_group_name][0] }}"
- inventory_hostname == groups[mon_group_name][0]
- containerized_deployment_with_kv
- mon_containerized_default_ceph_conf_with_kv
@ -29,7 +29,7 @@
- /etc/ceph/"{{ cluster }}".conf:/etc/ceph/ceph.defaults
run_once: true
when:
- "{{ inventory_hostname == groups[mon_group_name][0] }}"
- inventory_hostname == groups[mon_group_name][0]
- containerized_deployment_with_kv
- not mon_containerized_default_ceph_conf_with_kv

View File

@ -15,7 +15,7 @@
failed_when: false
check_mode: no
register: statconfig
when: "item | length > 0"
when: item | length > 0
- name: try to fetch ceph config and keys
copy: