Cloud VM #7
|
@ -2,23 +2,29 @@
|
||||||
hosts: cloud
|
hosts: cloud
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars:
|
vars:
|
||||||
project_src: /home/debian/cloud
|
project: cloud
|
||||||
module_defaults:
|
|
||||||
community.docker.docker_compose:
|
|
||||||
project_src: "{{ project_src }}"
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Wait for connection
|
- name: Wait for connection
|
||||||
ansible.builtin.wait_for_connection:
|
ansible.builtin.wait_for_connection:
|
||||||
timeout: 300
|
timeout: 300
|
||||||
|
- name: Get user
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: debian
|
||||||
|
register: user
|
||||||
- name: Copy project
|
- name: Copy project
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
directory_mode: true
|
directory_mode: true
|
||||||
src: ./cloud
|
src: ./{{ project }}
|
||||||
mode: "0744"
|
mode: "0744"
|
||||||
dest: "{{ project_src }}"
|
dest: "{{ user.home }}"
|
||||||
- name: Docker compose down
|
- name: Docker compose
|
||||||
community.docker.docker_compose:
|
module_defaults:
|
||||||
state: absent
|
community.docker.docker_compose:
|
||||||
- name: Docker compose up
|
project_src: "{{ user.home }}/{{ project }}"
|
||||||
community.docker.docker_compose:
|
block:
|
||||||
state: present
|
- name: Down
|
||||||
|
community.docker.docker_compose:
|
||||||
|
state: absent
|
||||||
|
- name: Up
|
||||||
|
community.docker.docker_compose:
|
||||||
|
state: present
|
||||||
|
|
Loading…
Reference in New Issue