From 220cff6e1c85d6489925c74ee31accf27be3fa59 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 26 Jan 2023 16:17:37 +0100 Subject: my_server: one step instead of three --- roles/my_server/tasks/main.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'roles/my_server/tasks/main.yml') diff --git a/roles/my_server/tasks/main.yml b/roles/my_server/tasks/main.yml index d88bb86..277f2d1 100644 --- a/roles/my_server/tasks/main.yml +++ b/roles/my_server/tasks/main.yml @@ -5,20 +5,12 @@ register: server_exists - when: server_exists.stat.exists + name: Update containers become: true - block: - # community.docker.docker_compose is too confusing for me to use, sorry. - - name: docker-compose pull - command: docker-compose pull --quiet - args: - chdir: '{{ server_dir }}' - - - name: docker-compose build - command: docker-compose build --pull - args: - chdir: '{{ server_dir }}' - - - name: docker-compose up - command: docker-compose up -d - args: - chdir: '{{ server_dir }}' + # community.docker.docker_compose is too confusing for me to use, sorry. + shell: | + docker-compose pull --quiet && \ + docker-compose build --pull && \ + docker-compose up -d + args: + chdir: '{{ server_dir }}' -- cgit v1.2.3