- name: make gitea directories ansible.builtin.file: path: "{{ item}}" state: directory loop: - /opt/stacks/gitea - /opt/stacks/gitea/data - name: Template out the compose file ansible.builtin.template: src: gitea-compose.yml.j2 dest: /opt/stacks/gitea/compose.yml owner: root mode: '0640' group: docker - name: deploy gitea stack community.docker.docker_compose_v2: project_src: /opt/stacks/gitea files: - compose.yml # Lets git over SSH (host port 222) through. Re-adds the rule if gitea's IP changed. - name: allow public ssh to gitea ansible.builtin.command: /usr/local/bin/ufw-docker.sh allow gitea 22/tcp register: gitea_ufw changed_when: "'Skipping' not in gitea_ufw.stdout" when: not ansible_check_mode