mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-10 05:38:34 +01:00
feat: usermanagement keycloak
This commit is contained in:
@@ -17,3 +17,6 @@ async_icinga_static_services:
|
|||||||
- { "name" : "backup_ths_server", "timeout" : "30d", "token" : "HISTORY_PURGED_SECRET" }
|
- { "name" : "backup_ths_server", "timeout" : "30d", "token" : "HISTORY_PURGED_SECRET" }
|
||||||
- { "name" : "backup_ths_storrage_box", "timeout" : "30d", "token" : "HISTORY_PURGED_SECRET" }
|
- { "name" : "backup_ths_storrage_box", "timeout" : "30d", "token" : "HISTORY_PURGED_SECRET" }
|
||||||
- { "name" : "backup_kathi_laptop", "timeout" : "30d", "token" : "HISTORY_PURGED_SECRET" }
|
- { "name" : "backup_kathi_laptop", "timeout" : "30d", "token" : "HISTORY_PURGED_SECRET" }
|
||||||
|
|
||||||
|
keycloak_admin_password: HISTORY_PURGED_SECRET
|
||||||
|
keycloak_postgres_password: HISTORY_PURGED_SECRET
|
||||||
|
|||||||
@@ -11,16 +11,16 @@
|
|||||||
file:
|
file:
|
||||||
name: /opt/
|
name: /opt/
|
||||||
state: directory
|
state: directory
|
||||||
mode: 711
|
mode: 0711
|
||||||
|
|
||||||
- name: Ensure backup info dir exists and accessible
|
- name: Ensure backup info dir exists and accessible
|
||||||
file:
|
file:
|
||||||
name: /opt/backup-info/
|
name: /opt/backup-info/
|
||||||
state: directory
|
state: directory
|
||||||
mode: 700
|
mode: 0700
|
||||||
|
|
||||||
- name: Copy Backup Helper script
|
- name: Copy Backup Helper script
|
||||||
copy:
|
copy:
|
||||||
src: check_dir_size_for_backup.py
|
src: check_dir_size_for_backup.py
|
||||||
dest: /opt/check_dir_size_for_backup.py
|
dest: /opt/check_dir_size_for_backup.py
|
||||||
mode: 755
|
mode: 0755
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
src: monitoring.conf.j2
|
src: monitoring.conf.j2
|
||||||
dest: /etc/monitoring.conf
|
dest: /etc/monitoring.conf
|
||||||
owner: root
|
owner: root
|
||||||
mode: 644
|
mode: 0644
|
||||||
|
|
||||||
- name: Add monitoring report cronjob
|
- name: Add monitoring report cronjob
|
||||||
cron:
|
cron:
|
||||||
|
|||||||
@@ -3,30 +3,28 @@
|
|||||||
name: /data/
|
name: /data/
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Create opt-dir
|
- name: Create compose directory keycloak
|
||||||
file:
|
file:
|
||||||
name: /opt/
|
name: "/opt/keycloak/"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Create compose directories
|
- name: Copy compose templates keycloak
|
||||||
file:
|
|
||||||
name: "/opt/{{ item }}"
|
|
||||||
state: directory
|
|
||||||
with_items:
|
|
||||||
- keycloak
|
|
||||||
|
|
||||||
- name: Copy compose templates
|
|
||||||
template:
|
template:
|
||||||
src: "{{ item }}.yaml"
|
src: "keycloak.yaml"
|
||||||
dest: "/opt/{{ item }}/"
|
dest: "/opt/keycloak/"
|
||||||
|
|
||||||
|
- name: Copy compose environment files keycloak
|
||||||
|
template:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: "/opt/keycloak/"
|
||||||
with_items:
|
with_items:
|
||||||
- keycloak
|
- keycloak.env
|
||||||
|
- postgres.env
|
||||||
|
- postgres_password
|
||||||
|
|
||||||
- name: Deploy compose templates
|
- name: Deploy compose templates
|
||||||
community.docker.docker_compose:
|
community.docker.docker_compose:
|
||||||
project_src: "/opt/{{ item }}/"
|
project_src: "/opt/keycloak/"
|
||||||
pull: true
|
pull: true
|
||||||
files:
|
files:
|
||||||
- "{{ item }}.yaml"
|
- "keycloak.yaml"
|
||||||
with_items:
|
|
||||||
- keycloak
|
|
||||||
|
|||||||
9
roles/usermanagement/templates/keycloak.env
Normal file
9
roles/usermanagement/templates/keycloak.env
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
KEYCLOAK_ADMIN=admin
|
||||||
|
KEYCLOAK_ADMIN_PASSWORD={{ keycloak_admin_password }}
|
||||||
|
PROXY_ADDRESS_FORWARDING=true
|
||||||
|
KC_PROXY=edge
|
||||||
|
KC_LOG_LEVEL=ALL
|
||||||
|
|
||||||
|
KC_DB_URL_HOST=postgres
|
||||||
|
KC_DB_USERNAME=keycloak
|
||||||
|
KC_DB_PASSWORD={{ keycloak_postgres_password }}
|
||||||
@@ -7,7 +7,7 @@ services:
|
|||||||
container_name: keycloak-container
|
container_name: keycloak-container
|
||||||
command: start-dev --http-enabled=true
|
command: start-dev --http-enabled=true
|
||||||
image: quay.io/keycloak/keycloak:18.0.0
|
image: quay.io/keycloak/keycloak:18.0.0
|
||||||
env_file: .env.keycloak
|
env_file: keycloak.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 5050:8080
|
- 5050:8080
|
||||||
@@ -18,7 +18,7 @@ services:
|
|||||||
postgres:
|
postgres:
|
||||||
container_name: postgres-container
|
container_name: postgres-container
|
||||||
image: postgres:13.2
|
image: postgres:13.2
|
||||||
env_file: .env.postgres
|
env_file: postgres.env
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
secrets:
|
secrets:
|
||||||
- postgres_password
|
- postgres_password
|
||||||
3
roles/usermanagement/templates/postgres.env
Normal file
3
roles/usermanagement/templates/postgres.env
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
POSTGRES_DB=keycloak
|
||||||
|
POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
|
||||||
|
POSTGRES_USER=keycloak
|
||||||
1
roles/usermanagement/templates/postgres_password
Normal file
1
roles/usermanagement/templates/postgres_password
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{{ keycloak_postgres_password }}
|
||||||
Reference in New Issue
Block a user