Deploy tandoor
This commit is contained in:
parent
10f43bc38d
commit
cc3f980d34
7 changed files with 86 additions and 0 deletions
|
@ -66,6 +66,7 @@
|
||||||
- pve_nebula_route
|
- pve_nebula_route
|
||||||
- privatebin
|
- privatebin
|
||||||
- vaultwarden
|
- vaultwarden
|
||||||
|
- tandoor
|
||||||
|
|
||||||
- hosts: ingress
|
- hosts: ingress
|
||||||
roles:
|
roles:
|
||||||
|
|
43
ansible/roles/tandoor/files/docker-compose.yml
Normal file
43
ansible/roles/tandoor/files/docker-compose.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
version: "2.3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
tandoor:
|
||||||
|
image: vabene1111/recipes:1.3.3
|
||||||
|
environment:
|
||||||
|
- TIMEZONE={{ timezone }}
|
||||||
|
- DEBUG=0
|
||||||
|
- ALLOWED_HOSTS=recipes.jakehoward.tech
|
||||||
|
- SECRET_KEY={{ tandoor_secret_key }}
|
||||||
|
- DATABASE_URL=postgres://tandoor:tandoor@db:5432/tandoor
|
||||||
|
- DB_ENGINE=django.db.backends.postgresql
|
||||||
|
- POSTGRES_HOST=db
|
||||||
|
- POSTGRES_PORT=5432
|
||||||
|
- POSTGRES_USER=tandoor
|
||||||
|
- POSTGRES_PASSWORD=tandoor
|
||||||
|
- GUNICORN_MEDIA=1
|
||||||
|
restart: unless-stopped
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.tandoor.rule=Host(`recipes.jakehoward.tech`)
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- default
|
||||||
|
- traefik
|
||||||
|
volumes:
|
||||||
|
- "{{ app_data_dir }}/tandoor/media:/opt/recipes/mediafiles"
|
||||||
|
tmpfs:
|
||||||
|
- /opt/recipes/staticfiles
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:14-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /mnt/tank/dbs/postgres/tandoor/:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=tandoor
|
||||||
|
- POSTGRES_USER=tandoor
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external: true
|
4
ansible/roles/tandoor/handlers/main.yml
Normal file
4
ansible/roles/tandoor/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- name: restart tandoor
|
||||||
|
shell:
|
||||||
|
chdir: /opt/tandoor
|
||||||
|
cmd: "{{ docker_update_command }}"
|
20
ansible/roles/tandoor/tasks/main.yml
Normal file
20
ansible/roles/tandoor/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
- name: Include vault
|
||||||
|
include_vars: vault.yml
|
||||||
|
|
||||||
|
- name: Create install directory
|
||||||
|
file:
|
||||||
|
path: /opt/tandoor
|
||||||
|
state: directory
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
mode: "{{ docker_compose_directory_mask }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Install compose file
|
||||||
|
template:
|
||||||
|
src: files/docker-compose.yml
|
||||||
|
dest: /opt/tandoor/docker-compose.yml
|
||||||
|
mode: "{{ docker_compose_file_mask }}"
|
||||||
|
owner: "{{ docker_user.name }}"
|
||||||
|
validate: docker-compose -f %s config
|
||||||
|
notify: restart tandoor
|
||||||
|
become: true
|
1
ansible/roles/tandoor/vars/main.yml
Normal file
1
ansible/roles/tandoor/vars/main.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
tandoor_secret_key: "{{ vault_tandoor_secret_key }}"
|
9
ansible/roles/tandoor/vars/vault.yml
Normal file
9
ansible/roles/tandoor/vars/vault.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
37383465336661346131616431653662623562386238373738383866336165663263363033323535
|
||||||
|
6339643539373037663938636636353362313064366636330a333637316665326530646430666663
|
||||||
|
35616463626139373136383538336466653236336330376534373931656435393562323033313730
|
||||||
|
3361613934643538650a646237326665313538613264303836393032666631346366653361303039
|
||||||
|
30353163346538356431303564613837363364323035313239623364643538663336383962396530
|
||||||
|
66663063333938363034316330333936633535346538323938346461343234636236363863353235
|
||||||
|
36323362396438613039313039353038323733613764383538393961626561373835653963336638
|
||||||
|
64393133353161656266
|
|
@ -139,3 +139,11 @@ resource "cloudflare_record" "jakehowardtech_vaultwarden" {
|
||||||
type = "A"
|
type = "A"
|
||||||
ttl = 1
|
ttl = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "cloudflare_record" "jakehowardtech_tandoor" {
|
||||||
|
zone_id = cloudflare_zone.jakehowardtech.id
|
||||||
|
name = "recipes"
|
||||||
|
value = linode_instance.casey.ip_address
|
||||||
|
type = "A"
|
||||||
|
ttl = 1
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue