diff --git a/ansible/.vault.sh b/ansible/.vault.sh deleted file mode 100755 index 8f30d37..0000000 --- a/ansible/.vault.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -echo $(pass show hosts/autonomic-dokku/vault/password) diff --git a/ansible/post-deploy.yml b/ansible/post-deploy.yml deleted file mode 100644 index 667acca..0000000 --- a/ansible/post-deploy.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- hosts: all - gather_facts: false - tasks: - - name: Load variables - include_vars: - dir: "{{ dokku_lib_root }}/data/ansible/keycloak/vars/" - extensions: - - yml - - - name: Set HTTP 80 port proxy - dokku_ports: - app: keycloak - mappings: - - "http:80:{{ http_port }}" - state: present - - - name: Setup LE certificates - shell: dokku letsencrypt keycloak - args: - creates: /home/dokku/keycloak/letsencrypt/certs - - - name: Setup LE certificates renew cron job - shell: dokku letsencrypt:cron-job --add - args: - creates: /home/dokku/keycloak/letsencrypt/cron-job - - - name: Remove automatically configured ports - dokku_ports: - app: keycloak - mappings: - - "http:{{ http_port }}:{{ http_port }}" - state: absent - - - name: Set HTTP 443 port - dokku_ports: - app: keycloak - mappings: - - "https:443:{{ http_port }}" - state: present diff --git a/ansible/pre-deploy.yml b/ansible/pre-deploy.yml deleted file mode 100644 index 864a798..0000000 --- a/ansible/pre-deploy.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- hosts: all - gather_facts: false - tasks: - - name: Load variables - include_vars: - dir: "{{ dokku_lib_root }}/data/ansible/keycloak/vars/" - extensions: - - yml - - - name: Configure id.autonomic.zone domain - dokku_domains: - app: keycloak - domains: - - id.autonomic.zone - state: present - - - name: Create mariadb database - no_log: true - shell: " - dokku - mariadb:create - keycloak - --password {{ db_passwd }} - --root-password {{ root_db_passwd }} - " - args: - creates: /var/lib/dokku/services/mariadb/keycloak - - - name: Link mariadb database to application - dokku_service_link: - app: keycloak - name: keycloak - service: mariadb - - - name: Specify mariadb docker volume mounts - dokku_storage: - app: keycloak - mounts: - - /var/lib/dokku/services/mariadb/keycloak:/var/lib/mysql - - - name: Configure the dokku app environment - dokku_config: - app: keycloak - restart: false - config: - DB_ADDR: "dokku-mariadb-keycloak:3306" - DB_DATABASE: "keycloak" - DB_PASSWORD: "{{ db_passwd }}" - DB_USER: "mariadb" # https://github.com/dokku/dokku-mariadb/issues/89 - DB_VENDOR: "mariadb" - DOKKU_LETSENCRYPT_EMAIL: "{{ autonomic_admin_mail }}" - KEYCLOAK_PASSWORD: "{{ autonomic_admin_pass }}" - KEYCLOAK_USER: "{{ autonomic_admin_user }}" - PROXY_ADDRESS_FORWARDING: "{{ proxy_address_forwarding }}" diff --git a/ansible/requirements.yml b/ansible/requirements.yml deleted file mode 100644 index 2ff94b9..0000000 --- a/ansible/requirements.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- src: dokku_bot.ansible_dokku - version: v2020.3.24 - -- src: https://git.autonomic.zone/autonomic-cooperative/autonomic.gandi/archive/0.0.3.tar.gz - name: autonomic.gandi diff --git a/ansible/vars/all.yml b/ansible/vars/all.yml deleted file mode 100644 index e49685b..0000000 --- a/ansible/vars/all.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -autonomic_admin_mail: helo@autonomic.zone -autonomic_admin_user: autonomic -http_port: "8080" -proxy_address_forwarding: "true" diff --git a/deploy.d/config.yml b/deploy.d/config.yml new file mode 100644 index 0000000..67e1630 --- /dev/null +++ b/deploy.d/config.yml @@ -0,0 +1,18 @@ +--- +environment: + DB_ADDR: "{{ dokku_db_addr }}" + DB_DATABASE: "keycloak" + DB_PASSWORD: "{{ db_passwd }}" + DB_USER: "{{ dokku_db_user }}" + DB_VENDOR: "mariadb" + KEYCLOAK_PASSWORD: "helo@autonomic.zone" + KEYCLOAK_USER: "autonomic" + PROXY_ADDRESS_FORWARDING: "true" + +settings: + http_port: 8080 + domain: id.autonomic.zone + database: + type: mariadb + password: "{{ db_passwd }}" + root_password: "{{ root_db_passwd }}" diff --git a/ansible/vars/ansible_become_pass.yml b/deploy.d/vault/ansible_become_pass.yml similarity index 100% rename from ansible/vars/ansible_become_pass.yml rename to deploy.d/vault/ansible_become_pass.yml diff --git a/ansible/vars/autonomic_admin_pass.yml b/deploy.d/vault/autonomic_admin_pass.yml similarity index 100% rename from ansible/vars/autonomic_admin_pass.yml rename to deploy.d/vault/autonomic_admin_pass.yml diff --git a/ansible/vars/db_passwd.yml b/deploy.d/vault/db_passwd.yml similarity index 100% rename from ansible/vars/db_passwd.yml rename to deploy.d/vault/db_passwd.yml diff --git a/ansible/vars/root_db_passwd.yml b/deploy.d/vault/root_db_passwd.yml similarity index 100% rename from ansible/vars/root_db_passwd.yml rename to deploy.d/vault/root_db_passwd.yml diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 130e91f..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -ansible==2.9.6