verschiebe Gitea start und Erreichbarkeitscheck
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 13s

This commit is contained in:
Marius Alwan Meyer 2023-04-29 14:51:39 +00:00
parent b52f8767f6
commit 172ec168b2
2 changed files with 22 additions and 27 deletions

View File

@ -74,21 +74,9 @@
mode: "600"
register: gitea_container
- name: Start Gitea
community.docker.docker_compose:
project_src: /opt/gitea
register: docker_compose
- ansible.builtin.debug:
var: docker_compose
- name: Check if {{ gitea.hostname }}.{{ gitea.domain }} is available and returning status 200
ansible.builtin.uri:
url: "https://{{ gitea.hostname }}.{{ gitea.domain }}"
register: _result
until: _result.status == 200
retries: 30
delay: 2
- name: Start Gitea and try reaching it
ansible.builtin.include_tasks:
file: start.yaml
rescue:
- name: Stop Gitea for Backup
@ -104,17 +92,12 @@
remote_src: true
mode: "700"
- name: Create / Recreate Gitea
community.docker.docker_compose:
project_src: /opt/gitea
state: present
restarted: true
- name: Start Gitea and Check Availability
ansible.builtin.include_tasks:
file: start.yaml
always:
- name: Check if {{ gitea.hostname }}.{{ gitea.domain }} is available and returning status 200
ansible.builtin.uri:
url: "https://{{ gitea.hostname }}.{{ gitea.domain }}"
register: _result
until: _result.status == 200
retries: 30
delay: 2
- ansible.builtin.debug:
var: docker_compose

12
tasks/start.yaml Normal file
View File

@ -0,0 +1,12 @@
- name: Start Gitea
community.docker.docker_compose:
project_src: /opt/gitea
register: docker_compose
- name: Check if {{ gitea.hostname }}.{{ gitea.domain }} is available and returning status 200
ansible.builtin.uri:
url: "https://{{ gitea.hostname }}.{{ gitea.domain }}"
register: _result
until: _result.status == 200
retries: 30
delay: 2