File tree 1 file changed +10
-17
lines changed
1 file changed +10
-17
lines changed Original file line number Diff line number Diff line change 5
5
repo_path : " /home/{{ ansible_user }}/iac/docker/{{ folder }}"
6
6
tasks :
7
7
- name : Ensure the repository is up-to-date
8
- shell : git pull
8
+ ansible.builtin. shell : git pull
9
9
args :
10
10
chdir : " {{ repo_path }}"
11
11
register : git_pull_output
12
12
13
13
- name : Display git pull output
14
- debug :
14
+ ansible.builtin. debug :
15
15
var : git_pull_output.stdout_lines
16
16
17
- - name : Restart services
18
- command : docker compose up -d --remove-orphans
19
- args :
20
- chdir : " {{ repo_path }}"
17
+ - name : Restart services using Docker Compose
18
+ community.docker.docker_compose_v2 :
19
+ project_src : " {{ repo_path }}"
20
+ state : present
21
+ remove_orphans : true
21
22
register : docker_compose_output
22
23
23
- - name : Display docker output
24
- debug :
25
- var : docker_compose_output.stdout_lines
26
-
27
- - name : Run Docker Command
28
- command : docker ps
29
- register : docker_output
30
-
31
- - name : Display Docker Output
32
- debug :
33
- var : docker_output.stdout_lines
24
+ - name : Display docker compose output
25
+ ansible.builtin.debug :
26
+ var : docker_compose_output
You can’t perform that action at this time.
0 commit comments