--- - name: Create directory ansible.builtin.file: path: /etc/futureporn/our state: directory mode: "0755" - name: Add a docker network community.docker.docker_network: name: our scope: swarm state: present driver: overlay when: inventory_hostname == groups['swarm'] | first - name: Clone the latest code ansible.builtin.git: repo: https://gitea.futureporn.net/futureporn/fp dest: /tmp/checkout single_branch: true version: main clone: true force: true - name: Copy compose files ansible.builtin.copy: remote_src: true src: "/tmp/checkout/services/our/{{ item }}" dest: "/etc/futureporn/our/{{ item }}" mode: "0744" loop: - compose.production.yaml - name: Render compose secrets ansible.builtin.template: mode: "0755" src: compose.secrets.j2.yaml dest: /etc/futureporn/our/compose.secrets.yaml - name: Deploy stack when: inventory_hostname == (groups['swarm'] | first) community.docker.docker_stack: state: present name: our compose: - /etc/futureporn/our/compose.production.yaml - /etc/futureporn/our/compose.secrets.yaml