Bootstrap homebase application
This commit is contained in:
5
ansible/.vault.sh
Executable file
5
ansible/.vault.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
echo $(pass show hosts/autonomic-dokku/vault/password)
|
42
ansible/post-deploy.yml
Normal file
42
ansible/post-deploy.yml
Normal file
@ -0,0 +1,42 @@
|
||||
---
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Load variables
|
||||
include_vars:
|
||||
dir: "{{ dokku_lib_root }}/data/ansible/homebase/vars/"
|
||||
extensions:
|
||||
- yml
|
||||
|
||||
- name: Set HTTP 80 port proxy
|
||||
dokku_ports:
|
||||
app: homebase
|
||||
mappings:
|
||||
- "http:80:{{ http_port }}"
|
||||
- "http:{{ dat_port }}:{{ dat_port }}"
|
||||
state: present
|
||||
|
||||
- name: Setup LE certificates
|
||||
shell: dokku letsencrypt homebase
|
||||
args:
|
||||
creates: /home/dokku/homebase/letsencrypt/certs
|
||||
|
||||
- name: Setup LE certificates renew cron job
|
||||
shell: dokku letsencrypt:cron-job --add
|
||||
args:
|
||||
creates: /home/dokku/homebase/letsencrypt/cron-job
|
||||
|
||||
- name: Remove automatically configured ports
|
||||
dokku_ports:
|
||||
app: homebase
|
||||
mappings:
|
||||
- "http:{{ dat_port }}:{{ dat_port }}"
|
||||
- "http:{{ http_port }}:{{ http_port }}"
|
||||
state: absent
|
||||
|
||||
- name: Set HTTP 443 port
|
||||
dokku_ports:
|
||||
app: homebase
|
||||
mappings:
|
||||
- "https:443:{{ http_port }}"
|
||||
state: present
|
39
ansible/pre-deploy.yml
Normal file
39
ansible/pre-deploy.yml
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Load variables
|
||||
include_vars:
|
||||
dir: "{{ dokku_lib_root }}/data/ansible/homebase/vars/"
|
||||
extensions:
|
||||
- yml
|
||||
|
||||
- name: "Configure {{ domain }} domain"
|
||||
dokku_domains:
|
||||
app: homebase
|
||||
domains:
|
||||
- "{{ domain }}"
|
||||
state: present
|
||||
|
||||
- name: Specify docker volume mount
|
||||
dokku_storage:
|
||||
app: homebase
|
||||
mounts:
|
||||
- /var/lib/homebase:/root/
|
||||
|
||||
- name: Configure the app environment
|
||||
dokku_config:
|
||||
app: homebase
|
||||
restart: false
|
||||
config:
|
||||
DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}"
|
||||
|
||||
- name: Copy template into place
|
||||
|
||||
- name: Symlink the authorized keys configuration
|
||||
template:
|
||||
src: homebase.yml.j2
|
||||
dest: /var/lib/.homebase.yml
|
||||
owner: dokku
|
||||
group: dokku
|
||||
become: true
|
3
ansible/requirements.yml
Normal file
3
ansible/requirements.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
- src: dokku_bot.ansible_dokku
|
||||
version: v2020.3.15
|
18
ansible/templates/homebase.yml.j2
Normal file
18
ansible/templates/homebase.yml.j2
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
directory: {{ dat_root }}
|
||||
|
||||
httpMirror: {{ http_mirror }}
|
||||
|
||||
letsencrypt: {{ auto_letsencrypt }}
|
||||
|
||||
dashboard: {{ dashboard }}
|
||||
|
||||
webapi:
|
||||
domain: {{ domain }}
|
||||
username: {{ webapi_username }}
|
||||
password: {{ webapi_password }}
|
||||
|
||||
ports:
|
||||
http: {{ http_port }}
|
||||
|
||||
dats: {{ dats }}
|
11
ansible/vars/all.yml
Normal file
11
ansible/vars/all.yml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
auto_letsencrypt: "false"
|
||||
dashboard: "false"
|
||||
dat_port: "3282"
|
||||
domain: "punkbase.autonomic.zone"
|
||||
http_mirror: "true"
|
||||
http_port: "8085"
|
||||
dat_root: "/root/.homebase"
|
||||
dats:
|
||||
# https://sunbeam.city/@kawaiipunk/103883932490360099
|
||||
- "dat://c403b7c92eb5e1b2c293425ee6623635be11211977787053e9797e94b958e6e0"
|
8
ansible/vars/ansible_become_pass.yml
Normal file
8
ansible/vars/ansible_become_pass.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
ansible_become_pass: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
34396236353735666531323238656533643465303131663464613162396333313836363630666266
|
||||
6539323631656635333864316166633064633366323936610a656137616334313534333635313232
|
||||
35323561303763366563316631313638363333393763323935343563303963616334336639386462
|
||||
3837383830616637360a373539613630356564363662393836366462666430353439353637303035
|
||||
63396633303166343433313439303539313637306637663137313533316531616434
|
9
ansible/vars/webapi_password.yml
Normal file
9
ansible/vars/webapi_password.yml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
webapi_username: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
30383532356364623139396134326537353934386538386638353936633638613862363161333736
|
||||
3661613834353137316538373130323035646531313061360a613335353563383366373362373338
|
||||
37656461346137616433613234326633646330393433663135323635376566396264356230336662
|
||||
6135313237303437340a343531333538376635393730383735616663383238376165393764656136
|
||||
63303639613631613333636634653465383138623736383133333532343830396166393166613263
|
||||
3163666132366235323262393135306133613333366132653434
|
8
ansible/vars/webapi_username.yml
Normal file
8
ansible/vars/webapi_username.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
webapi_username: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
61656131613735636330666533393534613664616134323564623939353738643937323666396334
|
||||
3235363739643361303833646666616137333063316663660a613035656531306638386533363164
|
||||
36643262666336306631363663623432623936643134333039373464333237323031303031383564
|
||||
3964393437643238630a356364633334343366326338616664646133376332313330306339306139
|
||||
3033
|
Reference in New Issue
Block a user