From: David Galloway Date: Wed, 2 Feb 2022 19:13:24 +0000 (-0500) Subject: cobbler_profile: Modernize dict combination X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e954bf59750729cbabf0bfb81648361d7268827c;p=ceph-cm-ansible.git cobbler_profile: Modernize dict combination Signed-off-by: David Galloway --- diff --git a/roles/cobbler_profile/tasks/import_distro.yml b/roles/cobbler_profile/tasks/import_distro.yml index adc30c2..a6f906e 100644 --- a/roles/cobbler_profile/tasks/import_distro.yml +++ b/roles/cobbler_profile/tasks/import_distro.yml @@ -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: