ansible-role-gitea/handlers/main.yaml

37 lines
977 B
YAML
Raw Normal View History

2023-05-01 22:38:08 +02:00
- name: Import backup handler
2023-05-01 01:48:07 +02:00
ansible.builtin.import_tasks:
file: backup.yaml
- name: Ensure Docker images are up to date
community.docker.docker_compose_v2_pull:
project_src: /opt/gitea
- name: Ensure Gitea is restarted
2024-04-10 19:57:47 +02:00
community.docker.docker_compose_v2:
project_src: /opt/gitea
state: restarted
register: docker_compose
- name: Ensure Gitea is running
2024-04-10 19:57:47 +02:00
community.docker.docker_compose_v2:
project_src: /opt/gitea
register: docker_compose
2023-05-01 22:38:08 +02:00
- name: Get Gitea HTTP response
ansible.builtin.uri:
url: "https://{{ gitea.hostname }}.{{ gitea.domain }}"
register: gitea_http_response
failed_when: 400 <= gitea_http_response.status < 500
- name: Wait until Gitea is up
ansible.builtin.uri:
url: "https://{{ gitea.hostname }}.{{ gitea.domain }}"
register: gitea_http_response
until: gitea_http_response.status == 200
retries: 30
delay: 2
2023-05-01 22:38:08 +02:00
- name: Output docker compose state
ansible.builtin.debug:
var: docker_compose