Skip to content

Commit

Permalink
Merge pull request #192 from dump-hr/sync-ansible-settings
Browse files Browse the repository at this point in the history
sync ansible settings with ddays-app
  • Loading branch information
bdeak4 authored Feb 3, 2024
2 parents 1b18e05 + 6701e9f commit b2663b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion infrastructure/ansible/playbooks/api/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
- role: traefik
- role: api
vars:
docker_tag: latest
docker_image: ghcr.io/dump-hr/internship-app:latest
env_file: production
api_domain: internship.dump.hr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- name: Create new api docker container
docker_container:
name: '{{ container_name }}'
image: 'ghcr.io/dump-hr/internship-app:{{ docker_tag }}'
image: '{{ docker_image }}'
pull: true
restart_policy: unless-stopped
env_file: '/home/{{ ansible_user }}/{{ env_file }}.env'
Expand Down Expand Up @@ -53,7 +53,14 @@
shell: docker rename "{{ container_name }}" api

rescue:
- name: Save unhealthy api docker container logs
shell: docker logs "{{ container_name }}" | sed -e 's/\x1b\[[0-9;]*m//g' > "/home/{{ ansible_user }}/unhealthy-$(date +%s)-{{ container_name }}.log" 2>&1

- name: Remove new unhealthy api docker container
docker_container:
name: '{{ container_name }}'
state: absent

- name: Return error
fail:
msg: New api docker container is unhealthy

0 comments on commit b2663b3

Please sign in to comment.