Use auth file instead of creds in quadlet files

This commit is contained in:
uumas
2025-10-06 16:17:27 +03:00
parent 2712cf2865
commit bdec55ffc7
12 changed files with 19 additions and 65 deletions

View File

@@ -6,9 +6,14 @@
- name: Create container image service {{ image_name }}
containers.podman.podman_image:
name: "{{ image_name }}"
username: "{{ image_creds.username if image_creds.username | length > 0 else omit }}"
password: "{{ image_creds.password if image_creds.password | length > 0 else omit }}"
state: quadlet
quadlet_filename: "{{ image_name | replace('/', '_') }}"
quadlet_file_mode: "0600"
quadlet_options: >-
{{
['AuthFile=/etc/containers/auth.json']
if image_name.split('/')[0] in
podman_registry_accounts | map(attribute='registry')
else []
}}
notify: Reload systemd daemon