[CORD-2950] Fix ansible 2.5.1 breakage by using union operator instead of iterating over docker image lists
Change-Id: I7b651d881870b7f0daff02d28f1b1213073aa51d
diff --git a/ansible/roles/genconfig/tasks/main.yml b/ansible/roles/genconfig/tasks/main.yml
index 8f4bde3..2f837db 100644
--- a/ansible/roles/genconfig/tasks/main.yml
+++ b/ansible/roles/genconfig/tasks/main.yml
@@ -79,20 +79,19 @@
- name: Add items to profile_container_list from profile_manifest.xos_services
set_fact:
- profile_container_list: "{{ profile_container_list }} + [ 'xosproject/{{ item.name }}-synchronizer' ]"
- with_items: "{{ profile_manifest.xos_services }}"
- when: item.synchronizer is not defined or item.synchronizer
+ profile_container_list: |
+ {{ profile_container_list | union(profile_manifest.xos_services | map(attribute='name') | map('regex_replace', '(.*)','xosproject/\1-synchronizer') | list) }}
- name: Add items to profile_container_list from profile_manifest.xos_dynamic_services
+ when: profile_manifest.xos_dynamic_services
set_fact:
- profile_container_list: "{{ profile_container_list }} + [ 'xosproject/{{ item.name }}-synchronizer' ]"
- with_items: "{{ profile_manifest.xos_dynamic_services if 'xos_dynamic_services' in profile_manifest else [] }}"
- when: item.synchronizer is not defined or item.synchronizer
+ profile_container_list: |
+ {{ profile_container_list | union(profile_manifest.xos_dynamic_services | map(attribute='name') | map('regex_replace', '(.*)','xosproject/\1-synchronizer') | list) }}
- name: Add items to profile_container_list from profile_manifest.enabled_gui_extensions
set_fact:
- profile_container_list: "{{ profile_container_list }} + [ 'xosproject/gui-extension-{{ item.name }}' ]"
- with_items: "{{ profile_manifest.enabled_gui_extensions }}"
+ profile_container_list: |
+ {{ profile_container_list | union(profile_manifest.enabled_gui_extensions | map(attribute='name') | map('regex_replace', '(.*)','xosproject/gui-extension-\1') | list) }}
- name: Update docker_image_whitelist to include containers specified by profile
set_fact: