- name: Update quadlets
  hosts: yellow
  tasks:
  - name: Copy quadlets with owner and permissions
    ansible.builtin.copy:
      src: "{{ item }}"
      dest: /usr/share/containers/systemd/
      owner: root
      group: root
      mode: '0644'
    loop:
    - ./quadlets/pihole.container
    - ./quadlets/cloudflared.container
    - ./quadlets/podman1.network
  - name: Daemon-reload to trigger re-read of quadlets
    ansible.builtin.systemd_service:
      daemon_reload: true
  - name: Restart all quadlet services
    ansible.builtin.systemd_service:
      state: restarted
      name: "{{ item }}"
    loop: ["podman1-network", "pihole", "iperf3", "cloudflared"]
