From d981c6bd20ce630f0be39e42913eb6285dceef5b Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 4 Apr 2018 11:46:51 +0200 Subject: [PATCH] site-docker: followup on #2487 get a non empty array as default value for `groups.get('clients')`, otherwise `| first` filter will complain because it can't work with empty array. Signed-off-by: Guillaume Abrioux --- site-docker.yml.sample | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site-docker.yml.sample b/site-docker.yml.sample index d7afeb715..f69397fb9 100644 --- a/site-docker.yml.sample +++ b/site-docker.yml.sample @@ -50,16 +50,16 @@ roles: - { role: ceph-defaults, tags: [with_pkg, fetch_container_image], - when: "(((containerized_deployment | bool) and not (is_atomic | bool) and not (inventory_hostname in groups.get('clients', [False]))) or ((inventory_hostname == groups.get('clients', [False])|first) and (containerized_deployment | bool) and not (is_atomic | bool)))" } + when: "(((containerized_deployment | bool) and not (is_atomic | bool) and not (inventory_hostname in groups.get('clients', []))) or ((inventory_hostname == groups.get('clients', [''])|first) and (containerized_deployment | bool) and not (is_atomic | bool)))" } - { role: ceph-docker-common, tags: [with_pkg, fetch_container_image], - when: "(((containerized_deployment | bool) and not (is_atomic | bool) and not (inventory_hostname in groups.get('clients', [False]))) or ((inventory_hostname == groups.get('clients', [False])|first) and (containerized_deployment | bool) and not (is_atomic | bool)))" } + when: "(((containerized_deployment | bool) and not (is_atomic | bool) and not (inventory_hostname in groups.get('clients', []))) or ((inventory_hostname == groups.get('clients', [''])|first) and (containerized_deployment | bool) and not (is_atomic | bool)))" } post_tasks: - name: "pull {{ ceph_docker_image }} image" command: "docker pull {{ ceph_docker_registry}}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" changed_when: false - when: "((is_atomic and (ceph_docker_dev_image is undefined or not ceph_docker_dev_image) and not (inventory_hostname in groups.get('clients', [False]))) or (is_atomic and ((ceph_docker_dev_image is undefined) or not (ceph_docker_dev_image)) and (inventory_hostname == groups.get('clients', [False])|first)))" + when: "((is_atomic and (ceph_docker_dev_image is undefined or not ceph_docker_dev_image) and not (inventory_hostname in groups.get('clients', []))) or (is_atomic and ((ceph_docker_dev_image is undefined) or not (ceph_docker_dev_image)) and (inventory_hostname == groups.get('clients', [''])|first)))" - hosts: mons tasks: @@ -279,7 +279,7 @@ start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" roles: - { role: ceph-defaults, tags: ['ceph_update_config'] } - - { role: ceph-docker-common, when: "inventory_hostname == groups.get('clients', []) | first" } + - { role: ceph-docker-common, when: "inventory_hostname == groups.get('clients', ['']) | first" } - { role: ceph-config, tags: ['ceph_update_config'] } - ceph-client post_tasks: -- 2.39.5