feat: Allow container auto update

This commit is contained in:
pulsar89.5 2024-06-18 12:36:04 +02:00
parent 56a9bd5fdc
commit 14e5cb0537
3 changed files with 23 additions and 0 deletions

View File

@ -7,6 +7,8 @@ podman_fix_pasta: true
podman_ssh_host: "{{ inventory_hostname }}" podman_ssh_host: "{{ inventory_hostname }}"
podman_ssh_port: 22 podman_ssh_port: 22
podman_auto_update: true
podman_containers: [] podman_containers: []
# Exemple: # Exemple:
# - image: docker.io/wallabag/wallabag:latest # - image: docker.io/wallabag/wallabag:latest

View File

@ -65,3 +65,18 @@
label: "{{ item.item.name }}" label: "{{ item.item.name }}"
vars: vars:
container_user: "podman-{{ item.item.user | default(item.item.name) }}" container_user: "podman-{{ item.item.user | default(item.item.name) }}"
- name: Activer le service de mise à jour automatique
ansible.builtin.systemd_service:
name: podman-auto-update.timer
daemon_reload: true
enabled: true
scope: user
when: podman_auto_update
become: true
become_user: "{{ container_user }}"
loop: "{{ deploy_container.results }}"
loop_control:
label: "{{ item.item.name }}"
vars:
container_user: "podman-{{ item.item.user | default(item.item.name) }}"

View File

@ -39,3 +39,9 @@
when: podman_configure_rsyslog when: podman_configure_rsyslog
become: true become: true
notify: Redémarrer rsyslog.service notify: Redémarrer rsyslog.service
- name: Désactiver le service de mise à jour automatique pour root
ansible.builtin.systemd_service:
name: podman-auto-update.timer
enabled: false
become: true