--- - name: Install Docker packages community.general.pacman: name: - docker - docker-compose - name: Create docker user user: name: docker group: docker - name: Create Gitea user user: name: gitea register: user_gitea when: '"gitea" in groups' - name: Create Syncthing group group: name: vault state: present when: '"syncthing" in groups' - name: Create Syncthing user user: name: syncthing group: vault register: user_syncthing when: '"syncthing" in groups' - name: Create Syncthing vault directory file: path: "{{ vault_path }}" state: directory owner: syncthing group: vault mode: "u=rwX,g=rwX,o=" - name: Create Syncthing config directory file: path: "{{ syncthing_conf_dir }}" state: directory owner: syncthing group: vault mode: "u=rwX,g=,o=" - name: Add unpriviledged user to file management group user: name: "{{ username }}" append: yes groups: vault when: '"syncthing" in groups' - name: Create docker-compose directory ansible.builtin.file: path: "{{ docker_compose_dir }}" owner: "{{ admin_username }}" group: "{{ admin_username }}" state: directory - name: Generate docker-compose.yml template: src: "docker-compose.yml.j2" dest: "{{ docker_compose_dir }}/docker-compose.yml" lstrip_blocks: true register: generateComp - name: Create systemd unit file template: src: "docker-compose.service.j2" dest: "/etc/systemd/system/docker-compose.service" - name: Compose up (update images if necessary) systemd: name: docker-compose state: reloaded enabled: true register: compUp