--- - hosts: all become: yes remote_user: ansible gather_facts: true vars: docker_compose_definition: | services: watchtower: image: containrrr/watchtower:latest command: --cleanup --label-enable --interval 3600 container_name: Watchtower volumes: - /var/run/docker.sock:/var/run/docker.sock labels: com.centurylinklabs.watchtower.enable: "true" restart: unless-stopped archiveTeamWarrior1: image: atdr.meo.ws/archiveteam/warrior-dockerfile container_name: archiveTeamWarrior1 hostname: archiveTeamWarrior1 dns: - 9.9.9.9 - 8.8.8.8 environment: - SELECTED_PROJECT=auto - SHARED_RSYNC_THREADS=10 - DOWNLOADER=jester45 - CONCURRENT_ITEMS=6 ports: - "8001:8001" labels: com.centurylinklabs.watchtower.enable: "true" restart: always archiveTeamWarrior2: image: atdr.meo.ws/archiveteam/warrior-dockerfile container_name: archiveTeamWarrior2 hostname: archiveTeamWarrior2 dns: - 9.9.9.9 - 8.8.8.8 environment: - SELECTED_PROJECT=auto - SHARED_RSYNC_THREADS=10 - DOWNLOADER=jester45 - CONCURRENT_ITEMS=6 ports: - "8002:8001" labels: com.centurylinklabs.watchtower.enable: "true" restart: always archiveTeamWarrior3: image: atdr.meo.ws/archiveteam/warrior-dockerfile container_name: archiveTeamWarrior3 hostname: archiveTeamWarrior3 dns: - 9.9.9.9 - 8.8.8.8 environment: - SELECTED_PROJECT=auto - SHARED_RSYNC_THREADS=10 - DOWNLOADER=jester45 - CONCURRENT_ITEMS=6 ports: - "8003:8001" labels: com.centurylinklabs.watchtower.enable: "true" restart: always tasks: - name: set-debcache.yml - Setup apt proxy debcache import_tasks: ../../lib/set-debcache.yml - name: Upgrade-packages.yml - update packages import_tasks: ../../lib/upgrade-packages.yml - name: Install-docker.yml - setting up docker import_tasks: ../../lib/install-docker.yml - name: Install Python Packages apt: name: - python3-full - python3-pip state: present update_cache: yes - name: Setup Service copy: dest: /etc/systemd/system/Warrior.service content: | [Unit] Description= After=network.target [Service] User=docker WorkingDirectory=/home/docker ExecStart=/usr/bin/docker compose -f docker-compose.yml up ExecStop=/usr/bin/docker compose -f docker-compose.yml down Restart=always [Install] WantedBy=multi-user.target owner: root group: root mode: '0644' - name: Write docker-compose.yml ansible.builtin.copy: content: "{{ docker_compose_definition }}" dest: /home/docker/docker-compose.yml owner: docker group: docker mode: u=rw,g=r,o=r - name: Reload systemd daemon systemd: daemon_reload: yes - name: Start Wikmd Service systemd: name: Warrior state: started enabled: yes