Skip to content

Commit a536936

Browse files
committed
format yaml files
1 parent 727e71e commit a536936

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

ansible/roles/common/tasks/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
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
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
- name: Restart docker
3-
service:
2+
- name: Restart Docker
3+
become: true
4+
ansible.builtin.service:
45
name: docker
56
state: restarted
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
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

ansible/roles/web_app/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
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

ansible/roles/web_app/tasks/wipe.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
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
@@ -19,5 +20,3 @@
1920
- name: Log Wipe Completion
2021
ansible.builtin.debug:
2122
msg: "Application {{ app_name }} wiped successfully"
22-
23-
when: web_app_wipe | bool

0 commit comments

Comments
 (0)