]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Deep-merge distros and extra_distros
authorZack Cerza <zack@redhat.com>
Fri, 5 Jun 2015 18:17:54 +0000 (12:17 -0600)
committerZack Cerza <zack@redhat.com>
Mon, 29 Jun 2015 22:37:06 +0000 (16:37 -0600)
So that we can override e.g. a mirror URL and keep all the other key/value
pairs

Signed-off-by: Zack Cerza <zack@redhat.com>
roles/cobbler_profile/tasks/import_distro.yml

index 8b290736998b6b571fd3a1c7792418f7e9061245..6140ab46347ee207b3c712c4ac20f0dbd5641922 100644 (file)
@@ -8,12 +8,11 @@
   debug: var=distro_name
 
 - name: Load extra_distros from secrets
+  # The jinja2 templating API allows you to update one dict with another,
+  # but it does so in-place without returning any dict. The first few
+  # blobs do the updating; the last actually returns the result.
   set_fact:
-      # The jinja2 templating API allows you to update one dict with
-      # another, but it does so in-place without returning any dict. The
-      # first blob does the updating; the second actually returns the
-      # result.
-      distros: "{{ distros.update(extra_distros|default({})) }}{{ distros}}"
+    distros: "{% for distro in distros.keys() + extra_distros.keys() %}{{ distros[distro].update(extra_distros[distro]|default({})) }}{% endfor %}{{ distros }}"
 
 - name: Find distro settings
   set_fact: