docker compose
Infrastructure / Check and run Ansbile playbooks (pull_request) Failing after 4m35s Details

This commit is contained in:
Gleb Koval 2023-09-26 00:40:09 +01:00
parent 400ce1590e
commit 6a900ecbc4
Signed by: cyclane
GPG Key ID: 15E168A8B332382C
4 changed files with 35 additions and 6 deletions

View File

@ -32,12 +32,6 @@
- docker-buildx-plugin
- docker-compose-plugin
become: true
- name: Enable docker
ansible.builtin.systemd:
name: docker
state: started
enabled: true
become: true
- name: Add user to docker group
ansible.builtin.user:
user: debian
@ -45,3 +39,9 @@
- docker
append: true
become: true
- name: Enable docker
ansible.builtin.systemd:
name: docker
state: started
enabled: true
become: true

View File

@ -0,0 +1,24 @@
- name: Deploy app
hosts: cloud
gather_facts: false
vars:
project_src: /home/debian/cloud
module_defaults:
community.docker.docker_compose:
project_src: "{{ project_src }}"
tasks:
- name: Wait for connection
ansible.builtin.wait_for_connection:
timeout: 300
- name: Copy project
ansible.builtin.copy:
directory_mode: true
src: ./cloud
mode: "0744"
dest: "{{ project_src }}"
- name: Docker compose down
community.docker.docker_compose:
state: absent
- name: Docker compose up
community.docker.docker_compose:
state: present

View File

@ -0,0 +1,5 @@
version: "3"
services:
test:
image: nginx