diff --git a/roles/role_deploy_SemanticScuttle/tasks/main.yml b/roles/role_deploy_SemanticScuttle/tasks/main.yml index 14116e6..30752b7 100644 --- a/roles/role_deploy_SemanticScuttle/tasks/main.yml +++ b/roles/role_deploy_SemanticScuttle/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_coturn/tasks/main.yml b/roles/role_deploy_coturn/tasks/main.yml index 0abab1f..81f10da 100644 --- a/roles/role_deploy_coturn/tasks/main.yml +++ b/roles/role_deploy_coturn/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_cron/tasks/main.yml b/roles/role_deploy_cron/tasks/main.yml index 2e7e57b..8623320 100644 --- a/roles/role_deploy_cron/tasks/main.yml +++ b/roles/role_deploy_cron/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_dovecot/tasks/main.yml b/roles/role_deploy_dovecot/tasks/main.yml index 1ce141f..4f4575c 100644 --- a/roles/role_deploy_dovecot/tasks/main.yml +++ b/roles/role_deploy_dovecot/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_feed2imap/tasks/main.yml b/roles/role_deploy_feed2imap/tasks/main.yml index 26801c7..2665725 100644 --- a/roles/role_deploy_feed2imap/tasks/main.yml +++ b/roles/role_deploy_feed2imap/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_fetchmail/tasks/main.yml b/roles/role_deploy_fetchmail/tasks/main.yml index cc078d9..ae86195 100644 --- a/roles/role_deploy_fetchmail/tasks/main.yml +++ b/roles/role_deploy_fetchmail/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_internal_named/tasks/main.yml b/roles/role_deploy_internal_named/tasks/main.yml index e900c37..120de6a 100644 --- a/roles/role_deploy_internal_named/tasks/main.yml +++ b/roles/role_deploy_internal_named/tasks/main.yml @@ -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 diff --git a/roles/role_deploy_nextcloud/tasks/main.yml b/roles/role_deploy_nextcloud/tasks/main.yml index 8d1213b..452854b 100644 --- a/roles/role_deploy_nextcloud/tasks/main.yml +++ b/roles/role_deploy_nextcloud/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_openvpn-server/tasks/main.yml b/roles/role_deploy_openvpn-server/tasks/main.yml index f6c6b51..1c07c0b 100644 --- a/roles/role_deploy_openvpn-server/tasks/main.yml +++ b/roles/role_deploy_openvpn-server/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_store-metrics-in-db/tasks/main.yml b/roles/role_deploy_store-metrics-in-db/tasks/main.yml index 349e40e..331cc2c 100644 --- a/roles/role_deploy_store-metrics-in-db/tasks/main.yml +++ b/roles/role_deploy_store-metrics-in-db/tasks/main.yml @@ -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 }}" diff --git a/roles/role_deploy_temp_openvpn-server/tasks/main.yml b/roles/role_deploy_temp_openvpn-server/tasks/main.yml index 7a66ac7..5f52d32 100644 --- a/roles/role_deploy_temp_openvpn-server/tasks/main.yml +++ b/roles/role_deploy_temp_openvpn-server/tasks/main.yml @@ -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 }}" diff --git a/tasks/deploy_mysql-server.yml b/tasks/deploy_mysql-server.yml index 9d5439d..bd0aaee 100644 --- a/tasks/deploy_mysql-server.yml +++ b/tasks/deploy_mysql-server.yml @@ -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 }}" diff --git a/tasks/deploy_reverse-proxy.yml b/tasks/deploy_reverse-proxy.yml index a2d5425..fb446bc 100644 --- a/tasks/deploy_reverse-proxy.yml +++ b/tasks/deploy_reverse-proxy.yml @@ -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 }}"