Add Keycloak #35

Merged
lukas merged 7 commits from add-keycloak into main 2021-06-20 16:31:39 +00:00
4 changed files with 53 additions and 0 deletions
Showing only changes of commit 6dcb21fe75 - Show all commits

View File

@ -14,6 +14,7 @@ homelab.
* NGINX * NGINX
* Jellyfin * Jellyfin
* PostgreSQL
=== Testing === Testing
To run locally, specify the inventory file with `-i hosts`. To run locally, specify the inventory file with `-i hosts`.

View File

@ -5,5 +5,7 @@
- nginx - nginx
- jellyfin - jellyfin
- openldap - openldap
- postgres
vars_files: vars_files:
- vault/certs/{{ base_domain }}.yml - vault/certs/{{ base_domain }}.yml
- vault/passwords.yml

View File

@ -0,0 +1,36 @@
- name: install psycopg2
pip:
name: psycopg2-binary
state: present
- name: ensure directories exist
file:
path: "{{ item }}"
state: directory
mode: "0755"
loop:
- "{{ data_folder }}/postgres/data"
- "{{ data_folder }}/postgres/init"
- name: copy init sql files
template:
src: "{{ item }}"
dest: "{{ data_folder }}/postgres/init/{{ item | basename | regex_replace('.j2$', '') }}"
with_fileglob:
- "../templates/*.sql.j2"
- name: create network
docker_network:
name: postgres
attachable: true
internal: true
state: present
- name: run container
docker_container:
name: "postgres"
image: "postgres:13"
networks:
- name: postgres
volumes:
- "{{ data_folder }}/postgres/data:/var/lib/postgresql/data"
- "{{ data_folder }}/postgres/init:/docker-entrypoint-initdb.d"
env:
POSTGRES_PASSWORD: "{{ vault_postgres_password }}"
state: started

14
vault/passwords.yml Normal file
View File

@ -0,0 +1,14 @@
$ANSIBLE_VAULT;1.1;AES256
32656133366339323166343734353434356561306461363033383266373733646161323166353438
3537666138666438373366353530626339303866353162340a386539353333323835383237356566
66636133383662333334396162323637393335336463316235386334353930616238623133613636
6535613536633662340a386333373465613466303137643232356664363233326561653235656263
63316130346236376235623632356364353538306439616362313837303438363736316137346237
36623333643062626532383439663730653139633836613636343232323437643564643531336661
34386135386437656135616536356538663731336261393636396562666337616462323330623732
65363536383238376166393563636532353336306335613131653261333662613965633265333462
30353564316435636330623434623832623463336231393630616266336435646434303963353665
63616631313863303838613362343538663236656235353966306231643132633938373935646466
63333036376136353831653236663631343761303830336461326264316563643037363935623731
38393037396530346232656366626535363539653462393663653739653935376436333934616562
3931