Bessere Namen für Tasks
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 10s
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 10s
This commit is contained in:
parent
32ac3f842a
commit
cf59550120
@ -5,7 +5,7 @@
|
|||||||
listen:
|
listen:
|
||||||
- Backup Gitea
|
- Backup Gitea
|
||||||
|
|
||||||
- name: Stop Gitea for Backup
|
- name: Stop Gitea for backup
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: /opt/gitea
|
project_src: /opt/gitea
|
||||||
state: present
|
state: present
|
||||||
@ -17,7 +17,7 @@
|
|||||||
- Ensure Gitea is running
|
- Ensure Gitea is running
|
||||||
when: docker_compose_stat.stat.exists is defined and docker_compose_stat.stat.exists
|
when: docker_compose_stat.stat.exists is defined and docker_compose_stat.stat.exists
|
||||||
|
|
||||||
- name: Backup Gitea Directory
|
- name: Backup Gitea directory
|
||||||
community.general.archive:
|
community.general.archive:
|
||||||
path: /opt/gitea/
|
path: /opt/gitea/
|
||||||
dest: "/var/backups/gitea-{{ gitea.hostname }}.{{ gitea.domain }}@{{ lookup('pipe', 'date --utc --iso-8601=seconds') }}.tar.gz"
|
dest: "/var/backups/gitea-{{ gitea.hostname }}.{{ gitea.domain }}@{{ lookup('pipe', 'date --utc --iso-8601=seconds') }}.tar.gz"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
- name: Import Backup Handler
|
- name: Import backup handler
|
||||||
ansible.builtin.import_tasks:
|
ansible.builtin.import_tasks:
|
||||||
file: backup.yaml
|
file: backup.yaml
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
project_src: /opt/gitea
|
project_src: /opt/gitea
|
||||||
register: docker_compose
|
register: docker_compose
|
||||||
|
|
||||||
- name: Get Gitea HTTP Response
|
- name: Get Gitea HTTP response
|
||||||
ansible.builtin.uri:
|
ansible.builtin.uri:
|
||||||
url: "https://{{ gitea.hostname }}.{{ gitea.domain }}"
|
url: "https://{{ gitea.hostname }}.{{ gitea.domain }}"
|
||||||
register: gitea_http_response
|
register: gitea_http_response
|
||||||
@ -27,6 +27,6 @@
|
|||||||
retries: 30
|
retries: 30
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
- name: Output Docker Compose State
|
- name: Output docker compose state
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
var: docker_compose
|
var: docker_compose
|
||||||
|
@ -5,19 +5,19 @@
|
|||||||
# - docker.io
|
# - docker.io
|
||||||
# - python3-docker
|
# - python3-docker
|
||||||
|
|
||||||
- name: Create git USER
|
- name: Ensure git user exists
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: git
|
name: git
|
||||||
register: git_user
|
register: git_user
|
||||||
|
|
||||||
- name: Create Gitea
|
- name: Ensure Gitea directory exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "/opt/gitea"
|
path: "/opt/gitea"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: root
|
||||||
mode: "755"
|
mode: "755"
|
||||||
|
|
||||||
- name: Create Data Directory
|
- name: Ensure data directory exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "/opt/gitea/data"
|
path: "/opt/gitea/data"
|
||||||
state: directory
|
state: directory
|
||||||
@ -25,7 +25,7 @@
|
|||||||
group: "{{ git_user.group }}"
|
group: "{{ git_user.group }}"
|
||||||
mode: "700"
|
mode: "700"
|
||||||
|
|
||||||
- name: Create Config Directory
|
- name: Ensure config directory exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "/opt/gitea/config"
|
path: "/opt/gitea/config"
|
||||||
state: directory
|
state: directory
|
||||||
@ -33,7 +33,7 @@
|
|||||||
group: "{{ git_user.group }}"
|
group: "{{ git_user.group }}"
|
||||||
mode: "700"
|
mode: "700"
|
||||||
|
|
||||||
- name: Start Docker Daemon
|
- name: Ensure docker daemon is started
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: docker
|
name: docker
|
||||||
enabled: true
|
enabled: true
|
||||||
@ -61,10 +61,10 @@
|
|||||||
notify:
|
notify:
|
||||||
- Backup Gitea
|
- Backup Gitea
|
||||||
|
|
||||||
- name: Execute Handlers before changing configfiles
|
- name: Execute handlers before changing configfiles
|
||||||
ansible.builtin.meta: flush_handlers
|
ansible.builtin.meta: flush_handlers
|
||||||
|
|
||||||
- name: Upload Environment File
|
- name: Upload environment.env
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: environment.env.j2
|
src: environment.env.j2
|
||||||
dest: "/opt/gitea/environment.env"
|
dest: "/opt/gitea/environment.env"
|
||||||
@ -81,6 +81,6 @@
|
|||||||
owner: root
|
owner: root
|
||||||
mode: "600"
|
mode: "600"
|
||||||
notify:
|
notify:
|
||||||
- Output Docker Compose State
|
- Output docker compose state
|
||||||
- Ensure Gitea is restarted
|
- Ensure Gitea is restarted
|
||||||
- Wait until Gitea is up
|
- Wait until Gitea is up
|
||||||
|
Loading…
Reference in New Issue
Block a user