- name: Ensure Quadlet files are present
  ansible.builtin.template:
    src: "{{ item }}.j2"
    dest: "/home/debian/.config/containers/systemd/{{ item }}"
    mode: '0755'
    owner: 'debian'
    group: 'debian'
  loop:
    - 'immich-app.container'
    - 'immich-postgres.container'
  # notify: 'restart immich'

- name: Ensure Quadlet files are present
  ansible.builtin.copy:
    src: "{{ item }}"
    dest: "/home/debian/.config/containers/systemd/{{ item }}"
    mode: '0755'
    owner: 'debian'
    group: 'debian'
  loop:
    - 'immich-redis.container'
    - 'immich.pod'
  # notify: 'restart immich'

- name: Ensure Caddyfile is present
  ansible.builtin.copy:
    src: 'immich.Caddyfile'
    dest: '/etc/caddy/immich.Caddyfile'
    owner: root
    group: root
    mode: '0644'
  become: true
  # notify: 'reload caddy'
