From ef6234cf92aec13cef48f189f8b8186e0d3510df Mon Sep 17 00:00:00 2001 From: gsparks Date: Wed, 9 Apr 2025 19:44:49 -0400 Subject: [PATCH] fix: add podman buildargs spacing --- src/molecule_plugins/podman/playbooks/create.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/molecule_plugins/podman/playbooks/create.yml b/src/molecule_plugins/podman/playbooks/create.yml index 88b14864..ae45c537 100644 --- a/src/molecule_plugins/podman/playbooks/create.yml +++ b/src/molecule_plugins/podman/playbooks/create.yml @@ -73,7 +73,15 @@ containers.podman.podman_image: build: extra_args: >- - {% if item.item.buildargs is defined %}{% for i, k in item.item.buildargs.items() %}--build-arg={{ i }}={{ k }}{% endfor %}{% endif %} + {{ + ( + item.item.buildargs | default({}) | dict2items | + map(attribute='key') | zip_longest( + item.item.buildargs | default({}) | dict2items | map(attribute='value') | map('regex_replace', '^(.*)$', '--build-arg=\\1'), + fillvalue='--build-arg=' + ) | map('join', '') | list + ) | join(' ') + }} {% if item.item.pull is defined %}--pull={{ item.item.pull }}{% endif %} file: "{{ item.dest }}" name: "molecule_local/{{ item.item.image }}"