Add podman logout before podman login in case registry was recreated

This commit is contained in:
yohan 2024-10-20 15:56:41 +02:00
parent d7eea85c4b
commit d9490616c4
13 changed files with 120 additions and 1 deletions

View File

@ -107,6 +107,15 @@
changed_when: duplicity_result.rc is defined and duplicity_result.rc == 0
when: not scuttle_restored_flag.stat.exists
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -1,4 +1,13 @@
---
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -107,6 +107,15 @@
mode: "u=rw,g=r,o="
become: true
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -165,6 +165,15 @@
- name: dovecot_expire.sh
mode: "u=rwx,g=rx,o="
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -49,6 +49,15 @@
with_items:
- feed2imaprc
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -69,6 +69,15 @@
mode: "u=rw,g=r,o="
become: true
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -60,18 +60,29 @@
- named.conf.options
- named.conf.local
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"
password: "{{ private_registry_password }}"
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Create internal_named container
containers.podman.podman_container:
name: internal_named
image: registry.scimetis.net/named:432924fb0b
image: "{{ private_registry_domain }}/named:432924fb0b"
ports:
- 127.0.0.1:53:53/tcp
- 127.0.0.1:53:53/udp

View File

@ -84,6 +84,15 @@
- supervisord.conf
- run_elasticsearch.sh
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -86,6 +86,15 @@
recurse: yes
become: true
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -33,6 +33,15 @@
with_items:
- conf.yml
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -6,6 +6,15 @@
mode: '0755'
become: true
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -31,6 +31,15 @@
ansible.builtin.include_tasks: "tasks/mysql-server_install_from_backup_stage_2.yml"
when: not mysql_restored_flag.stat.exists
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"

View File

@ -103,6 +103,15 @@
become: true
when: not reverse_proxy_restored_flag.stat.exists
# podman logout is needed before podman login if registry was recreated
- name: Logout from {{ private_registry_domain }}
containers.podman.podman_logout:
registry: "{{ private_registry_domain }}"
changed_when: false
# We ignore failures because the image should be in the cache
failed_when: false
become: true
- name: Login to {{ private_registry_domain }} and create ${XDG_RUNTIME_DIR}/containers/auth.json
containers.podman.podman_login:
username: "{{ private_registry_user }}"