Compare commits
2 Commits
00cad09f37
...
6a900ecbc4
Author | SHA1 | Date |
---|---|---|
Gleb Koval | 6a900ecbc4 | |
Gleb Koval | 400ce1590e |
|
@ -32,15 +32,16 @@
|
||||||
- docker-buildx-plugin
|
- docker-buildx-plugin
|
||||||
- docker-compose-plugin
|
- docker-compose-plugin
|
||||||
become: true
|
become: true
|
||||||
- name: Enable docker
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: docker
|
|
||||||
state: started
|
|
||||||
enabled: true
|
|
||||||
become: true
|
|
||||||
- name: Add user to docker group
|
- name: Add user to docker group
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
user: debian
|
user: debian
|
||||||
groups:
|
groups:
|
||||||
- docker
|
- docker
|
||||||
append: true
|
append: true
|
||||||
|
become: true
|
||||||
|
- name: Enable docker
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: docker
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
become: true
|
||||||
|
|
|
@ -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
|
|
@ -0,0 +1,5 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
test:
|
||||||
|
image: nginx
|
Loading…
Reference in New Issue