- hosts: rpi5.home.lan
  name: Sync rpi5
  become: true
  tasks:
    - name: Get running packages
      ansible.builtin.shell: "docker ps|awk '{print $NF}'"
      register: containers
    - debug:
        msg: "{{ containers.stdout_lines }}"
    - name: Stop containers
      ansible.builtin.shell: "docker stop {{ item }}"
      register: containers
      when: item != "NAMES" and item != "watchtower-watchtower-1"
      with_items: "{{ containers.stdout_lines }}"
    - name: Sync data
      ansible.builtin.shell: "/myapps/venv/bin/python3 /myapps/omv_backup.py -r all"
