--- - name: Create directory ansible.builtin.file: path: /etc/futureporn/our state: directory mode: "0755" - name: Copy env file ansible.builtin.copy: src: ../../../../.env.production dest: /etc/futureporn/our/.env mode: "0600" - 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 the compose file ansible.builtin.copy: remote_src: true src: /tmp/checkout/services/our/compose.production.yaml dest: /etc/futureporn/our/compose.production.yaml mode: "0744" - name: Deploy stack to green community.docker.docker_stack: state: present name: our-green compose: - /etc/futureporn/our/compose.production.yaml - services: server: ports: - target: 5000 # container port published: 8084 # Swarm ingress port protocol: tcp mode: ingress - name: Deploy stack to blue community.docker.docker_stack: state: present name: our-blue compose: - /etc/futureporn/our/compose.production.yaml - services: server: ports: - target: 5000 # container port published: 8085 # Swarm ingress port protocol: tcp mode: ingress # - name: Remove stack # community.docker.docker_stack: # name: mystack # state: absent