From 2f3caee8534903c8cf853effc681b8c9dd32be99 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Sun, 20 Oct 2024 23:15:17 +0200 Subject: [PATCH] Add registry login. --- tasks/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 }}"