]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
cobbler_profile: Modernize dict combination
authorDavid Galloway <dgallowa@redhat.com>
Wed, 2 Feb 2022 19:13:24 +0000 (14:13 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 2 Feb 2022 19:13:24 +0000 (14:13 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/cobbler_profile/tasks/import_distro.yml

index adc30c237705dc9c987b86560304550b4c3edf7b..a6f906e14751ef9fa68bceace9972df672fdbaff 100644 (file)
@@ -8,11 +8,8 @@
   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:
-    distros: "{% for distro in distros.keys() + extra_distros.keys() %}{{ distros[distro].update(extra_distros[distro]|default({})) }}{% endfor %}{{ distros }}"
+    distros: "{{ distros|combine(extra_distros, recursive=True) }}"
 
 - name: Find distro settings
   set_fact: