From 562f0a2983bda71e548c1027076ebf7da343f462 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Tue, 26 Sep 2023 01:49:40 +0100 Subject: [PATCH] don't use docker_compose module --- infra/cloud/0000_proxmox_playbook.yaml | 2 +- infra/cloud/0002_docker_playbook.yaml | 1 - infra/cloud/0003_app_playbook.yaml | 21 ++++++++++----------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/infra/cloud/0000_proxmox_playbook.yaml b/infra/cloud/0000_proxmox_playbook.yaml index 990bf43..e90aa9b 100644 --- a/infra/cloud/0000_proxmox_playbook.yaml +++ b/infra/cloud/0000_proxmox_playbook.yaml @@ -85,7 +85,7 @@ - name: Resize root disk community.general.proxmox_disk: disk: scsi0 - size: 16 + size: 16G state: resized - name: Create data disk community.general.proxmox_disk: diff --git a/infra/cloud/0002_docker_playbook.yaml b/infra/cloud/0002_docker_playbook.yaml index cff249e..b2a09fe 100644 --- a/infra/cloud/0002_docker_playbook.yaml +++ b/infra/cloud/0002_docker_playbook.yaml @@ -31,7 +31,6 @@ - containerd.io - docker-buildx-plugin - docker-compose-plugin - - python3-docker become: true - name: Add user to docker group ansible.builtin.user: diff --git a/infra/cloud/0003_app_playbook.yaml b/infra/cloud/0003_app_playbook.yaml index 26b5aac..0736263 100644 --- a/infra/cloud/0003_app_playbook.yaml +++ b/infra/cloud/0003_app_playbook.yaml @@ -16,14 +16,13 @@ src: ./{{ project }} dest: "{{ user.home }}" mode: "0744" - - name: Docker compose - module_defaults: - community.docker.docker_compose: - project_src: "{{ user.home }}/{{ project }}" - block: - - name: Down - community.docker.docker_compose: - state: absent - - name: Up - community.docker.docker_compose: - state: present + notify: re-deploy + handlers: + - name: Restart Docker compose + ansible.builtin.shell: | + docker compose down + docker compose up -d + exit 0 + args: + chdir: "{{ user.home }}/{{ project }}" + listen: re-deploy