Add reitanlage-oranienburg website to services
This commit is contained in:
parent
f8c478b2e6
commit
519882db43
5 changed files with 63 additions and 2 deletions
|
@ -36,6 +36,8 @@
|
||||||
tags: [influxdb, sensors, monitoring]
|
tags: [influxdb, sensors, monitoring]
|
||||||
- role: jellyfin
|
- role: jellyfin
|
||||||
tags: [jellyfin, media]
|
tags: [jellyfin, media]
|
||||||
|
- role: reitanlage_oranienburg
|
||||||
|
tags: [reitanlage-oranienburg, website]
|
||||||
- role: synapse
|
- role: synapse
|
||||||
tags: [synapse, matrix, communication]
|
tags: [synapse, matrix, communication]
|
||||||
- role: tandoor
|
- role: tandoor
|
||||||
|
|
26
_ansible/roles/reitanlage_oranienburg/tasks/main.yml
Normal file
26
_ansible/roles/reitanlage_oranienburg/tasks/main.yml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
- name: Set common facts
|
||||||
|
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||||
|
|
||||||
|
- name: Deploy {{ svc.name }}
|
||||||
|
vars:
|
||||||
|
svc: "{{ reitanlage_oranienburg_svc }}"
|
||||||
|
compose: "{{ reitanlage_oranienburg_compose }}"
|
||||||
|
block:
|
||||||
|
- name: Import prepare tasks for common service
|
||||||
|
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||||
|
|
||||||
|
- name: Get the Dockerfile
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: https://raw.githubusercontent.com/getgrav/docker-grav/master/Dockerfile
|
||||||
|
dest: "{{ (service_path, 'Dockerfile') | path_join }}"
|
||||||
|
mode: "0644"
|
||||||
|
register: cmd_result
|
||||||
|
|
||||||
|
- name: Set the docker rebuild flag
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
docker_rebuild: true
|
||||||
|
when: cmd_result.changed # noqa: no-handler We need to handle the restart per service. Handlers don't support variables.
|
||||||
|
|
||||||
|
- name: Import start tasks for common service
|
||||||
|
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
23
_ansible/roles/reitanlage_oranienburg/vars/main.yml
Normal file
23
_ansible/roles/reitanlage_oranienburg/vars/main.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
reitanlage_oranienburg_svc:
|
||||||
|
name: reitanlage-oranienburg
|
||||||
|
domain: reitanlage-oranienburg.de
|
||||||
|
www_domain: true
|
||||||
|
port: 80
|
||||||
|
caddy_extra: |
|
||||||
|
header /images/* Cache-Control "max-age=31536000"
|
||||||
|
header /assets/* Cache-Control "max-age=2629800"
|
||||||
|
header /user/themes/* Cache-Control "max-age=2629800"
|
||||||
|
|
||||||
|
reitanlage_oranienburg_compose:
|
||||||
|
watchtower: false
|
||||||
|
image: grav
|
||||||
|
volumes:
|
||||||
|
- data:/var/www/html/
|
||||||
|
file:
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
volumes:
|
||||||
|
data:
|
|
@ -3,3 +3,4 @@
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
service_path: "{{ (services_path, role_name | replace('_', '-')) | path_join }}"
|
service_path: "{{ (services_path, role_name | replace('_', '-')) | path_join }}"
|
||||||
docker_force_recreate: ""
|
docker_force_recreate: ""
|
||||||
|
docker_rebuild: false
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
---
|
---
|
||||||
|
- name: Rebuild service
|
||||||
|
ansible.builtin.command:
|
||||||
|
cmd: docker compose build --pull
|
||||||
|
chdir: "{{ service_path }}"
|
||||||
|
when:
|
||||||
|
- docker_rebuild
|
||||||
|
register: cmd_result
|
||||||
|
changed_when: true # TODO
|
||||||
|
|
||||||
- name: Build service
|
- name: Build service
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: docker compose build --pull
|
cmd: docker compose build --pull
|
||||||
|
@ -8,7 +17,7 @@
|
||||||
- docker_update is defined
|
- docker_update is defined
|
||||||
- docker_update
|
- docker_update
|
||||||
register: cmd_result
|
register: cmd_result
|
||||||
changed_when: true
|
changed_when: true # TODO
|
||||||
|
|
||||||
- name: Pull service
|
- name: Pull service
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
|
@ -19,7 +28,7 @@
|
||||||
- docker_update is defined
|
- docker_update is defined
|
||||||
- docker_update
|
- docker_update
|
||||||
register: cmd_result
|
register: cmd_result
|
||||||
changed_when: true
|
changed_when: true # TODO
|
||||||
|
|
||||||
- name: Start service
|
- name: Start service
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
|
|
Reference in a new issue