diff --git a/tasks/main.yml b/tasks/main.yml index 7f205c8..7331c90 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -14,6 +14,23 @@ - debug: var=commit +# podman logout is needed before podman login if registry was recreated +- name: Logout from registry + containers.podman.podman_logout: + registry: "{{ image.push_dest }}" + changed_when: false + become: true + when: image.push | default(False) | bool + +- name: Login to registry and create ${XDG_RUNTIME_DIR}/containers/auth.json + containers.podman.podman_login: + username: "{{ image.push_user }}" + password: "{{ image.push_pwd }}" + registry: "{{ image.push_dest }}" + changed_when: false + become: true + when: image.push | default(False) | bool + - name: Build {{ image.name }} image containers.podman.podman_image: name: "{{ image.name }}:{{ commit }}"