ansible-community / molecule-plugins

Collection on molecule plugins
MIT License
101 stars 67 forks source link

Podman: build compatible Ansible image task don't use custom podman executable #253

Closed ghoudmon closed 3 weeks ago

ghoudmon commented 2 months ago

Description

Podman driver allows to customize the podman executable path. This custom path is passed to all containers.podman modules, except for the task Build an Ansible compatible image.

Current behavior

    - name: Build an Ansible compatible image # noqa: no-handler
      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 %}
            {% if item.item.pull is defined %}--pull={{ item.item.pull }}{% endif %}
          file: "{{ item.dest }}"
        name: "molecule_local/{{ item.item.image }}"
        path: "{{ molecule_scenario_directory }}"
        pull: "{{ item.item.pull | default(omit) }}"
      loop: "{{ platforms.results }}"

Expected behavior

    - name: Build an Ansible compatible image # noqa: no-handler
      containers.podman.podman_image:
        executable: "{{ podman_exec }}"
        build:
          extra_args: >-
            {% if item.item.buildargs is defined %}{% for i, k in item.item.buildargs.items() %}--build-arg={{ i }}={{ k }}{% endfor %}{% endif %}
            {% if item.item.pull is defined %}--pull={{ item.item.pull }}{% endif %}
          file: "{{ item.dest }}"
        name: "molecule_local/{{ item.item.image }}"
        path: "{{ molecule_scenario_directory }}"
        pull: "{{ item.item.pull | default(omit) }}"
      loop: "{{ platforms.results }}"