File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222 rescue :
2323 - name : Fix missing packages and retry update
24- ansible.builtin.command : apt-get update --fix-missing
24+ ansible.builtin.apt :
25+ update_cache : yes
26+ force_apt_get : yes
2527 become : true
26- changed_when : false
2728
2829 always :
2930 - name : Log package block completion
Original file line number Diff line number Diff line change 11---
2- - name : Restart docker
3- service :
2+ - name : Restart Docker
3+ become : true
4+ ansible.builtin.service :
45 name : docker
56 state : restarted
Original file line number Diff line number Diff line change 11---
2- - name : Restart app container
3- shell : |
2+ - name : Restart application container
3+ become : true
4+ ansible.builtin.shell : |
45 docker stop "{{ app_container_name }}" || true
56 docker rm "{{ app_container_name }}" || true
67 docker run -d --name "{{ app_container_name }}" -p {{ app_port }}:5000 --restart unless-stopped "{{ docker_image }}:{{ docker_image_tag }}"
8+ args :
9+ warn : false
Original file line number Diff line number Diff line change 2121 ansible.builtin.template :
2222 src : docker-compose.yml.j2
2323 dest : " {{ compose_project_dir }}/docker-compose.yml"
24+ mode : " 0644"
2425
2526 - name : Deploy application
2627 ansible.builtin.command : docker compose up -d
Original file line number Diff line number Diff line change 22- name : Wipe Web Application
33 tags :
44 - web_app_wipe
5+ when : web_app_wipe | bool
56 block :
67
78 - name : Stop And Remove Docker Compose Containers
1920 - name : Log Wipe Completion
2021 ansible.builtin.debug :
2122 msg : " Application {{ app_name }} wiped successfully"
22-
23- when : web_app_wipe | bool
You can’t perform that action at this time.
0 commit comments