Repository: apache/airavata-custos (language: python)

Issue:
Writing ansible scripts to deploy Custos
As part of the Custos baremetal deployment effort - we need to write ansible scripts to configure and automate deployments.
Writing ansible scripts to deploy Custos
As part of the Custos baremetal deployment effort - we need to write ansible scripts to configure and automate deployments.
Writing ansible scripts to deploy Custos
As part of the Custos baremetal deployment effort - we need to write ansible scripts to configure and automate deployments.
Writing ansible scripts to deploy Custos
As part of the Custos baremetal deployment effort - we need to write ansible scripts to configure and automate deployments.
Added custos authentication server, client, common utilities and thrift files
Added the following modules:
1. **custos-authentication**: This contains the authentication server and handler functions to authenticate gateway users using keycloak. 
2. **custos-client**: Authentication service client
3. **custos-commons**: utility functions shared by custos services
4. **custos-connectors**: contains Keycloak manager which connects with Keycloak standalone service via REST API
5. **custos-profile-service**: contains user-profile-service, tenant-profile-service and iam-admin-services
6. **ide-integration**: this is for development purpose and to start custos services locally. 
7. **thrift-interfaces**: contains thrift files used for generating service apis and models


Discussion / hints:

Fix patch:
diff --git a/ansible/.gitignore b/ansible/.gitignore
index fffbb8241..2a22f0cd5 100644
--- a/ansible/.gitignore
+++ b/ansible/.gitignore
@@ -1,1 +1,2 @@
 ENV
+vault_pass
diff --git a/ansible/README.md b/ansible/README.md
index 6451a89ed..820361b92 100644
--- a/ansible/README.md
+++ b/ansible/README.md
@@ -67,13 +67,11 @@ all:
 Ansible connects to these VMs using `ssh`. To allow ansible to do this, you will also need to provide it with ssh passwords for these VMs. To maintain security, these passwords cannot be exposed in plaintext. We use ansible's `ansible-vault` command to encrypt these password strings.
 
 Open the file `test/group_vars/all/vault.yml`. You will need to decrypt the file to access it (it's been encrypted using ansible-vault for security).
+Make sure you put the password text in this file - `ansible/vault_pass`. You can reach out to the dev team to get the password for test env.
 Here's the command:
 ```bash
 ansible-vault decrypt inventories/test/group_vars/all/vault.yml
 ```
-You will be prompted to provide the `ansible-vault` password. You can reach out to the dev team to get the password for test env.
-
-After you've set the respective passwords, don't forget to encrypot the 
 
 In the file `test/group_vars/all/vault.yml`. Look for `keycloak_ssh_password`, `hashicorp_ssh_password` and `custos_ssh_password` variables. Set these variables with their respective password strings. For ex:
 ```yml
@@ -92,12 +90,13 @@ ansible-vault encrypt inventories/test/group_vars/all/vault.yml
 
 Now that you've configured the ssh user and password details for your VMs, we can install nginx on each of these servers at once by running the following command:
 ```bash
-ansible-playbook -i inventories/test/ custos.yml --ask-vault-pass --tags env_setup
+ansible-playbook -i inventories/test/ custos.yml --tags env_setup
 ```
-Enter the Vault Password (that you got from airavata dev) when prompted by ansible.
 
 ## Generate SSL certificates<a name="generate-ssl-certificates"/>
-The `env_setup.yml` playbook installed `certbot` along with `nginx` in your VMs. **Certbot** helps manage letsencrypt SSL certificates. You need to generate SSL certs for each of your 3 VMs.
+The `env_setup.yml` playbook installed `certbot` along with `nginx` in your VMs. 
+
+Now **Certbot** will help us manage letsencrypt SSL certificates. You need to generate SSL certs for each of your 3 VMs.
 
 ### Generate letsencrypt certificates
 SSH into your VMs with your user:
@@ -115,12 +114,14 @@ Run the following commands to generate pkcs12 truststore files from you cert and
 
 In the hashicorp VM:
 ```bash
-openssl pkcs12 -export -out certs/vault-client-truststore.pkcs12 -inkey /etc/letsencrypt/live/<my-hashicorp-domain.com>/privkey.pem -in /etc/letsencrypt/live/<my-hashicorp-domain.com>/fullchain.pem
+sudo openssl pkcs12 -export -out certs/vault-client-truststore.pkcs12 -inkey /etc/letsencrypt/live/<my-hashicorp-domain.com>/privkey.pem -in /etc/letsencrypt/live/<my-hashicorp-domain.com>/fullchain.pem
 ```
 In the keycloak VM:
 ```bash
-openssl pkcs12 -export -out certs/keycloak-client-truststore.pkcs12 -inkey /etc/letsencrypt/live/<my-keycloak-domain.com>/privkey.pem -in /etc/letsencrypt/live/<my-keycloak-domain.com>/fullchain.pem
+sudo openssl pkcs12 -export -out certs/keycloak-client-truststore.pkcs12 -inkey /etc/letsencrypt/live/<my-keycloak-domain.com>/privkey.pem -in /etc/letsencrypt/live/<my-keycloak-domain.com>/fullchain.pem
 ```
+You should see the respective pkcs12 file in the `~/certs` folder.
+
 Now, you need to add the pkcs12 passwords in the ansible vars.
 
 In the file `test/group_vars/all/vault.yml`. Look for `hashicorp_pkcs12_passphrase` and `keycloak_pkcs12_passphrase` variables. Set these variables with their respective password strings. For ex:
@@ -155,4 +156,7 @@ Adding multiple -v will increase the verbosity, the builtin plugins currently ev
 ```bash
 ansible all -i inventories/test/ -e '@inventories/test/group_vars/all/vars.yml' --ask-vault-pass -m debug -a 'var=secret_string'
 ```
-
+- Encrypt a string using `ansible-vault`
+```bash
+ansible-vault encrypt_string "MySecureString"
+```
diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg
index dd43d2bfa..82f67dcc7 100644
--- a/ansible/ansible.cfg
+++ b/ansible/ansible.cfg
@@ -1,2 +1,3 @@
 [defaults]
 host_key_checking = false
+vault_password_file = vault_pass
diff --git a/ansible/custos.yml b/ansible/custos.yml
index 3cfb7e64a..f5c86e2a3 100644
--- a/ansible/custos.yml
+++ b/ansible/custos.yml
@@ -19,26 +19,28 @@
 #
 
 ---
-#- hosts: hashicorp
-#  roles:
-#    - env_setup
-#    - nginx
-#    - consul
-#    - vault
-#
-#- hosts: keycloak
-#  roles:
-#    - env_setup
-#    - nginx
-#    - keycloak
-#- hosts: old_server
-#  roles:
-#    - migrate_db
+- hosts: old_custos
+  roles:
+    - migrate_db
+- hosts: old_keycloak
+  roles:
+    - migrate_db
+- hosts: old_hashicorp
+  roles:
+    - migrate_db
+- hosts: hashicorp
+  roles:
+    - nginx
+    - consul
+    - vault
+- hosts: keycloak
+  roles:
+    - nginx
+    - keycloak
 - hosts: custos
   roles:
-#    - env_setup
-#    - nginx
-#    - database
-#    - zookeeper
-#    - kafka
-    - custos
+    - nginx
+    - database
+    - zookeeper
+    - kafka
+    - custos
\ No newline at end of file
diff --git a/ansible/roles/consul/tasks/main.yml b/ansible/roles/consul/tasks/main.yml
index 4f5f46af0..fd41c101b 100644
--- a/ansible/roles/consul/tasks/main.yml
+++ b/ansible/roles/consul/tasks/main.yml
@@ -51,7 +51,6 @@
   template:
     dest: "{{ consul_config_dir }}/config.json"
     src: consul.config.j2
-  notify: restart consul
   become: yes
 
 - name: ensure consul service file exists
@@ -62,7 +61,20 @@
     mode: 0644
   become: yes
 
+- name: restart consul
+  service:
+    name: consul
+    state: restarted
+  become: yes
+
+- name: Copy snapshot from master node to new server
+  copy:
+    src: tmp/primary.snap
+    dest: /home/exouser/backups/
+
+#- name: import snapshot to consul server
+
 - name: Reload systemd daemons
   command: systemctl daemon-reload
   notify: restart consul
-  become: yes
\ No newline at end of file
+  become: yes
diff --git a/ansible/roles/database/tasks/import_db.yml b/ansible/roles/database/tasks/import_db.yml
index 3449b2548..a576367ba 100644
--- a/ansible/roles/database/tasks/import_db.yml
+++ b/ansible/roles/database/tasks/import_db.yml
@@ -27,13 +27,13 @@
     encoding: "UTF8mb3"
     collation: "utf8_general_ci"
 
-#- name: Copy dump file from master node to new server
-#  copy:
-#    src: tmp/core_services_server_db_arch.sql
-#    dest: /home/exouser/backups
-#
-#- name: import dump file to mysql
-#  mysql_db:
-#    name: core_services_server_db
-#    state: import
-#    target: /home/exouser/backups/core_services_server_db_arch.sql
+- name: Copy dump file from master node to new server
+  copy:
+    src: tmp/core_services_server_db_arch.sql
+    dest: /home/exouser/backups/
+
+- name: import dump file to mysql
+  mysql_db:
+    name: core_services_server_db
+    state: import
+    target: /home/exouser/backups/core_services_server_db_arch.sql
diff --git a/ansible/roles/database/tasks/keycloak.yml b/ansible/roles/database/tasks/keycloak.yml
deleted file mode 100644
index 396492aa5..000000000
--- a/ansible/roles/database/tasks/keycloak.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
----
-
-# Setup keycloak user and database
-- name: create keycloak database
-  mysql_db: name="keycloak" state=present encoding=utf8
-  when: "'keycloak' in groups"
-
-- name: give access to {{ keycloak_db_username }} from remote
-  mysql_user: name="{{ keycloak_db_username }}" password="{{ keycloak_db_password }}" host="{{ item }}"
-  with_items:
-    - "{{ groups['keycloak'] }}"
-
-- name: create new user {{ keycloak_db_username }} with all privilege
-  mysql_user: name="{{ keycloak_db_username }}"
-              password="{{ keycloak_db_password }}"
-              append_privs=yes
-              host_all=yes
-              priv=keycloak.*:ALL,GRANT state=present
diff --git a/ansible/roles/keycloak/defaults/main.yml b/ansible/roles/keycloak/defaults/main.yml
index 2949ceec7..31edf5f83 100644
--- a/ansible/roles/keycloak/defaults/main.yml
+++ b/ansible/roles/keycloak/defaults/main.yml
@@ -32,9 +32,8 @@ keycloak_master_account_password: "password"
 # keycloak_server_port: "443"
 
 keycloak_db_host: "localhost"
-keycloak_db_port: "3306"
 keycloak_db_schema_name: "postgresDB"
-keycloak_db_url: "jdbc:postgresql://{{keycloak_db_host}}:{{keycloak_db_port}}/{{keycloak_db_schema_name}}"
+keycloak_db_url: "jdbc:postgresql://{{keycloak_db_host}}/{{keycloak_db_schema_name}}"
 keycloak_db_username: "postgres"
 keycloak_db_password: "postgres"
 keycloak_db_pool_size: "20"
diff --git a/ansible/roles/keycloak/tasks/main.yml b/ansible/roles/keycloak/tasks/main.yml
index de9967b8b..be7417dc3 100644
--- a/ansible/roles/keycloak/tasks/main.yml
+++ b/ansible/roles/keycloak/tasks/main.yml
@@ -18,51 +18,6 @@
 #
 
 ---
-#- name: Install httpd
-#  apt: name="httpd" state=latest update_cache=yes
-#  become: yes
-#
-#- name: allow httpd to proxy to Keycloak process
-#  seboolean:
-#    name: httpd_can_network_connect
-#    state: yes
-#    persistent: yes
-#  become: yes
-#
-#- name: Enable http/s service on public zone (for certbot verification)
-#  firewalld: service={{ item }} permanent=true state=enabled zone=public immediate=True
-#  with_items:
-#    - http
-#    - https
-#  become: yes
-#
-## TODO: it seems like a virtual host config of some type is needed for the following to work
-#- name: copy basic virtual host file so certbot can verify domain
-#  template: src="basic-vhost.conf.j2" dest=/etc/httpd/conf.d/basic-vhost.conf backup=yes
-#  become: yes
-#
-#- name: start httpd
-#  service: name=httpd state=started enabled=yes
-#  become: yes
-#
-#- name: check if SSL certificate exists
-#  stat:
-#    path: "{{ keycloak_ssl_certificate_file }}"
-#  register: stat_ssl_cert_result
-#  become: yes
-#
-#- name: generate certificate if it doesn't exist
-#  command: certbot --apache --non-interactive --agree-tos --email "{{ letsencrypt_email }}" -d {{ keycloak_vhost_servername }} certonly
-#  become: yes
-#  when: not stat_ssl_cert_result.stat.exists
-#
-#- name: Add keycloak virtual host config that proxies to the keycloak server
-#  template: src="vhost.conf.j2" dest=/etc/httpd/conf.d/keycloak.conf backup=yes
-#  become: yes
-#  notify:
-#    - restart httpd
-
-
 - name: Install Keycloak pre-requisites (Debian)
   apt: name={{ item }} state=latest update_cache=yes
   with_items:
@@ -71,7 +26,6 @@
   when: ansible_os_family == "Debian"
 
 - name: Create Keycloak deployment directory {{ keycloak_install_dir }}
-  become: yes
   file: path={{ keycloak_install_dir }}
     state=directory
     mode=0755
@@ -79,7 +33,6 @@
     group={{ group }}
 
 - name: Create Keycloak source directory
-  become: yes
   file: path={{ keycloak_source_dir }}
     state=directory
     mode=0755
@@ -95,24 +48,20 @@
     force: yes
   register: checkout
   tags: update
-  become: yes
   become_user: "{{ user }}"
 
 - name: Run Keycloak maven build
   command: mvn -Pdistribution -pl distribution/server-dist -am -Dmaven.test.skip clean install chdir="{{ keycloak_source_dir }}/"
-#  mvn clean install -Dmaven.test.skip=true chdir="{{ keycloak_source_dir }}/"
   environment:
     MAVEN_OPTS: "-Xmx2048m"
   register: build
   tags: update
-  become: yes
   become_user: "{{ user }}"
 
 - name: Delete configuration directories of the distributions
   file:
     state: absent
     path: "{{ keycloak_install_dir }}/standalone/configuration"
-  become: yes
   become_user: "{{ user }}"
   ignore_errors: yes
 
@@ -122,9 +71,33 @@
     src: "{{ keycloak_source_dir }}/distribution/server-dist/target/keycloak-{{ keycloak_version }}.zip"
     dest: "{{ user_home }}"
     copy: no
+  become_user: "{{ user }}"
+
+- name: Create modules/system/layers/keycloak/org/postgresql directory
+  become: yes
+  file:
+    path: "{{ keycloak_deployment_dir }}/modules/system/layers/keycloak/org/postgresql/main"
+    state: directory
+    mode: 0755
+    owner: "{{ user }}"
+    group: "{{ group }}"
+
+- name: copy module.xml to org/postgresql dir
+  template:
+    src: module.xml.j2
+    dest: "{{ keycloak_deployment_dir }}/modules/system/layers/keycloak/org/postgresql/main/module.xml"
+    owner: "{{ user }}"
+    group: "{{ group }}"
+    mode: '0644'
   become: yes
   become_user: "{{ user }}"
 
+- name: Download postgresql jar
+  ansible.builtin.get_url:
+    url: https://jdbc.postgresql.org/download/postgresql-42.3.6.jar
+    dest: "{{ keycloak_deployment_dir }}/modules/system/layers/keycloak/org/postgresql/main/postgresql-42.3.6.jar"
+    mode: '0644'
+
 # setup postgresql for keycloak
 - name: Install postgresql and postgresql-contrib
   apt:
@@ -132,7 +105,14 @@
       - postgresql
       - postgresql-contrib
   become: yes
-#  become_user: "{{ user }}"
+
+- name: "Install Python packages"
+  apt:
+    name: "{{ item }}"
+    state: present
+  with_items:
+    - python3-psycopg2
+  become: yes
 
 - name: Start the postgresql service
   service:
@@ -140,53 +120,65 @@
     state: started
     enabled: yes
   become: yes
-  become_user: "{{ user }}"
-#
-## <---------------------------- Setup Mysql database for keycloak ------------------->
-#
-## create folder structure
-#- file:
-#    path: "{{user_home}}/{{ keycloak_inkeycloak_install_dir }}/modules/system/layers/keycloak/org/mysql/main"
-#    state: directory
-#    mode: 0755
-#  become: true
-#  become_user: "{{ user }}"
-#  tags:
-#       - always
-#
-#- name: Download and unarchive mysql jdbc driver
-#  unarchive: src="{{ mysql_db_connector_download_url }}"
-#      dest="{{ user_home }}"
-#      copy=no
-#      owner="{{ user }}"
-#      group="{{ group }}"
-#      creates="{{user_home}}/{{keycloak_db_connector_name}}/{{keycloak_db_connector_name}}-bin.jar"
-#  become: true
-#  become_user: "{{ user }}"
-#  tags:
-#       - always
-#
-#- name: move jdbc connector to keycloak module
-#  command: mv {{user_home}}/{{keycloak_db_connector_name}}/{{keycloak_db_connector_name}}-bin.jar {{user_home}}/{{ keycloak_install_dir }}/modules/system/layers/keycloak/org/mysql/main/
-#  become: true
-#  become_user: "{{ user }}"
-#  tags:
-#       - always
-#
-#- name: copy jdbc module configuration file
-#  template: >
-#    src=module.j2
-#    dest="{{user_home}}/{{ keycloak_install_dir }}/modules/system/layers/keycloak/org/mysql/main/module.xml"
-#    owner="{{ user }}"
-#    group="{{ group }}"
-#    mode="u=rw,g=r,o=r"
-#  become: true
-#  become_user: "{{ user }}"
-#  tags:
-#       - always
-#
-## </---------------------------- Setup Mysql database for keycloak - END ------------------->
-#
+
+- name: "Create database"
+  postgresql_db:
+    state: present
+    name: "{{ keycloak_db_schema_name }}"
+    login_password: "{{ keycloak_db_password }}"
+  become: yes
+  become_user: postgres
+
+- name: "Create db user"
+  postgresql_user:
+    state: present
+    name: "{{ keycloak_db_username }}"
+    password: "{{ keycloak_db_password }}"
+    login_password: "{{ keycloak_db_password }}"
+  become: yes
+  become_user: postgres
+
+- name: "Grant db user access to app db"
+  postgresql_privs:
+    type: database
+    database: "{{ keycloak_db_schema_name }}"
+    roles: "{{ keycloak_db_username }}"
+    grant_option: no
+    privs: all
+    login_password: "{{ keycloak_db_password }}"
+  become: yes
+  become_user: postgres
+
+- name: copy postgres hba conf
+  template:
+    src: pg_hba.conf.j2
+    dest: /etc/postgresql/12/main/pg_hba.conf
+    owner: root
+    group: root
+    mode: '0644'
+  become: yes
+
+- name: Restart the postgresql service
+  service:
+    name: postgresql
+    state: restarted
+  become: yes
+
+- name: Copy dump file from master node to new server
+  copy:
+    src: tmp/postgresDB_arch.sql
+    dest: /home/exouser/backups/
+
+# TODO: It appends dump -> but we need to replace it
+- name: Restore dump
+  postgresql_db:
+    state: restore
+    name: "{{ keycloak_db_schema_name }}"
+    target: /home/exouser/backups/postgresDB_arch.sql
+    login_password: "{{ keycloak_db_password }}"
+  become: yes
+  become_user: postgres
+
 # <---------------------------- Server Configuration -------------------------------->
 
 # SSL Configuration & postgresql
@@ -197,7 +189,6 @@
     owner="{{ user }}"
     group="{{ group }}"
     mode="u=rw,g=r,o=r"
-  become: true
   become_user: "{{ user }}"
   tags:
        - standalone
@@ -206,62 +197,47 @@
 
 # <---------- setup init script for keycloak, starts the server after reboot ----------->
 
-# Init script to start keycloak in Standalone mode
-- name: copy init script file (Standalone)
+- name: Create Keycloak run directory
+  become: yes
+  file:
+    path: "{{ user_home }}/run"
+    state: directory
+    mode: 0755
+    owner: "{{ user }}"
+    group: "{{ group }}"
+
+- name: Copy keycloak script to run directory
   template: >
     src=keycloak-standalone-init.j2
-    dest="/etc/init.d/keycloak"
+    dest="{{ user_home }}/run/keycloak.sh"
     owner="{{ user }}"
     group="{{ group }}"
     mode="u=rwx,g=rx,o=rx"
-  become: yes
-  become_user: root
+  become_user: "{{ user }}"
   tags:
-       - standalone
-
-## System command to add the init script to enable on startup
-#- name: add init script to chkconfig and startup on boot
-#  command: chkconfig --level 345 keycloak on
-#  become: yes
-#  become_user: root
-#  tags:
-#       - always
-
-# </---------- setup init script for keycloak, starts the server after reboot ----------->
+    - standalone
 
-# <-------------------------Initialize a new admin for keycloak-------------------------->
-
-- name: Add master realm admin account
-  command: "{{user_home}}/{{ keycloak_install_dir }}/bin/add-user-keycloak.sh -r master -u {{ keycloak_master_account_username }} -p {{ keycloak_master_account_password }}"
-  args:
-    creates: "{{user_home}}/{{ keycloak_install_dir }}/standalone/configuration/keycloak-add-user.json"
+- name: copy systemd script file (Standalone) for {{ user }}
+  template: >
+    src=keycloak.service.j2
+    dest="/etc/systemd/system/keycloak.service"
+    owner="{{ user }}"
+    group="{{ group }}"
+    mode="u=rwx,g=rx,o=rx"
   become: yes
-  become_user: root
   tags:
-       - always
-
+    - standalone
 
 # <--------------------------start keycloak Identity server------------------------------>
-- name: reload Keycloak init script
+- name: reload systemctl daemon
   command: systemctl daemon-reload
   become: yes
-  become_user: root
-  tags:
-       - always
-
-# FIXME: restarting Keycloak server doesn't work
-- name: stop Keycloak server
-  service: name=keycloak state=stopped
-  ignore_errors: yes
-  become: yes
-  become_user: root
   tags:
        - always
 
 - name: start Keycloak server
-  service: name=keycloak state=started
+  service:
+    name: keycloak
+    state: restarted
+    enabled: yes
   become: yes
-  become_user: root
-  tags:
-       - always
-...
diff --git a/ansible/roles/keycloak/templates/keycloak-hacluster-init.j2 b/ansible/roles/keycloak/templates/keycloak-hacluster-init.j2
deleted file mode 100644
index c9b9cca5c..000000000
--- a/ansible/roles/keycloak/templates/keycloak-hacluster-init.j2
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-#
-# chkconfig: 35 90 12
-# description: keycloak server
-#
-
-# Get function from functions library
-. /etc/init.d/functions
-
-# Start the service Keycloak
-start() {
-        initlog -c "echo -n Starting Keycloak server: "
-        nohup {{ user_home }}/{{ keycloak_install_dir }}/bin/standalone.sh -b 0.0.0.0 --server-config=standalone-ha.xml &
-        ### Create the lock file ###
-        touch /var/lock/subsys/keycloak
-        success $"keycloak server running"
-        echo
-}
-
-# Restart the service FOO
-stop() {
-        initlog -c "echo -n Stopping keycloak server: "
-        ps aux | grep keycloak | grep -v grep | awk '{print $2}' | xargs kill
-        ### Now, delete the lock file ###
-        rm -f /var/lock/subsys/keycloak
-        echo
-}
-
-### main logic ###
-case "$1" in
-  start)
-        start
-        ;;
-  stop)
-        stop
-        ;;
-  status)
-        status keycloak
-        ;;
-  restart|reload|condrestart)
-        stop
-        start
-        ;;
-  *)
-        echo $"Usage: $0 {start|stop|restart|reload|status}"
-        exit 1
-esac
-
-exit 0
\ No newline at end of file
diff --git a/ansible/roles/keycloak/templates/keycloak-standalone-init.j2 b/ansible/roles/keycloak/templates/keycloak-standalone-init.j2
index bc7abe40c..6a3943010 100644
--- a/ansible/roles/keycloak/templates/keycloak-standalone-init.j2
+++ b/ansible/roles/keycloak/templates/keycloak-standalone-init.j2
@@ -5,13 +5,14 @@
 #
 
 # Get function from functions library
-. /etc/init.d/functions
+. /lib/lsb/init-functions
+#. /etc/init.d/functions
 
 # Start the service Keycloak
 start() {
-        nohup {{ user_home }}/{{ keycloak_install_dir }}/bin/standalone.sh -b 0.0.0.0 &
+        {{ user_home }}/{{ keycloak_install_dir }}/bin/standalone.sh
         ### Create the lock file ###
-        touch /var/lock/subsys/keycloak
+        #touch /v/keycloak
         echo $"keycloak server running"
 }
 
@@ -19,7 +20,7 @@ start() {
 stop() {
         ps aux | grep keycloak | grep -v grep | awk '{print $2}' | xargs kill
         ### Now, delete the lock file ###
-        rm -f /var/lock/subsys/keycloak
+        #rm -f /var/lock/subsys/keycloak
         echo $"keycloak server stopped"
 }
 
@@ -41,6 +42,4 @@ case "$1" in
   *)
         echo $"Usage: $0 {start|stop|restart|reload|status}"
         exit 1
-esac
-
-exit 0
\ No newline at end of file
+esac
\ No newline at end of file
diff --git a/ansible/roles/keycloak/templates/keycloak.service.j2 b/ansible/roles/keycloak/templates/keycloak.service.j2
new file mode 100644
index 000000000..9b64c892c
--- /dev/null
+++ b/ansible/roles/keycloak/templates/keycloak.service.j2
@@ -0,0 +1,14 @@
+[Unit]
+Description=Keycloak service
+
+[Service]
+User={{ user }}
+Group={{ group }}
+ExecStart={{ user_home }}/run/keycloak.sh  start
+ExecStop={{ user_home }}/run/keycloak.sh  stop
+Restart=always
+TimeoutSec=60
+Type=Forking
+
+[Install]
+WantedBy=multi-user.target
\ No newline at end of file
diff --git a/ansible/roles/keycloak/templates/module.xml.j2 b/ansible/roles/keycloak/templates/module.xml.j2
new file mode 100644
index 000000000..8eed0982a
--- /dev/null
+++ b/ansible/roles/keycloak/templates/module.xml.j2
@@ -0,0 +1,12 @@
+<?xml version="1.0" ?>
+<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
+
+    <resources>
+        <resource-root path="postgresql-42.3.6.jar"/>
+    </resources>
+
+    <dependencies>
+        <module name="javax.api"/>
+        <module name="javax.transaction.api"/>
+    </dependencies>
+</module>
\ No newline at end of file
diff --git a/ansible/roles/keycloak/templates/pg_hba.conf.j2 b/ansible/roles/keycloak/templates/pg_hba.conf.j2
new file mode 100644
index 000000000..02d32e5c6
--- /dev/null
+++ b/ansible/roles/keycloak/templates/pg_hba.conf.j2
@@ -0,0 +1,103 @@
+# PostgreSQL Client Authentication Configuration File
+# ===================================================
+#
+# Refer to the "Client Authentication" section in the PostgreSQL
+# documentation for a complete description of this file.  A short
+# synopsis follows.
+#
+# This file controls: which hosts are allowed to connect, how clients
+# are authenticated, which PostgreSQL user names they can use, which
+# databases they can access.  Records take one of these forms:
+#
+# local         DATABASE  USER  METHOD  [OPTIONS]
+# host          DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
+# hostssl       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
+# hostnossl     DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
+# hostgssenc    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
+# hostnogssenc  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
+#
+# (The uppercase items must be replaced by actual values.)
+#
+# The first field is the connection type: "local" is a Unix-domain
+# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
+# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
+# non-SSL TCP/IP socket.  Similarly, "hostgssenc" uses a
+# GSSAPI-encrypted TCP/IP socket, while "hostnogssenc" uses a
+# non-GSSAPI socket.
+#
+# DATABASE can be "all", "sameuser", "samerole", "replication", a
+# database name, or a comma-separated list thereof. The "all"
+# keyword does not match "replication". Access to replication
+# must be enabled in a separate record (see example below).
+#
+# USER can be "all", a user name, a group name prefixed with "+", or a
+# comma-separated list thereof.  In both the DATABASE and USER fields
+# you can also write a file name prefixed with "@" to include names
+# from a separate file.
+#
+# ADDRESS specifies the set of hosts the record matches.  It can be a
+# host name, or it is made up of an IP address and a CIDR mask that is
+# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
+# specifies the number of significant bits in the mask.  A host name
+# that starts with a dot (.) matches a suffix of the actual host name.
+# Alternatively, you can write an IP address and netmask in separate
+# columns to specify the set of hosts.  Instead of a CIDR-address, you
+# can write "samehost" to match any of the server's own IP addresses,
+# or "samenet" to match any address in any subnet that the server is
+# directly connected to.
+#
+# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
+# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
+# Note that "password" sends passwords in clear text; "md5" or
+# "scram-sha-256" are preferred since they send encrypted passwords.
+#
+# OPTIONS are a set of options for the authentication in the format
+# NAME=VALUE.  The available options depend on the different
+# authentication methods -- refer to the "Client Authentication"
+# section in the documentation for a list of which options are
+# available for which authentication methods.
+#
+# Database and user names containing spaces, commas, quotes and other
+# special characters must be quoted.  Quoting one of the keywords
+# "all", "sameuser", "samerole" or "replication" makes the name lose
+# its special character, and just match a database or username with
+# that name.
+#
+# This file is read on server startup and when the server receives a
+# SIGHUP signal.  If you edit the file on a running system, you have to
+# SIGHUP the server for the changes to take effect, run "pg_ctl reload",
+# or execute "SELECT pg_reload_conf()".
+#
+# Put your actual configuration here
+# ----------------------------------
+#
+# If you want to allow non-local connections, you need to add more
+# "host" records.  In that case you will also need to make PostgreSQL
+# listen on a non-local interface via the listen_addresses
+# configuration parameter, or via the -i or -h command line switches.
+
+
+
+
+# DO NOT DISABLE!
+# If you change this first entry you will need to make sure that the
+# database superuser can access the database using some other method.
+# Noninteractive access to all databases is required during automatic
+# maintenance (custom daily cronjobs, replication, and similar tasks).
+#
+# Database administrative login by Unix domain socket
+local   all             postgres                                md5
+
+# TYPE  DATABASE        USER            ADDRESS                 METHOD
+
+# "local" is for Unix domain socket connections only
+local   all             all                                     peer
+# IPv4 local connections:
+host    all             all             127.0.0.1/32            md5
+# IPv6 local connections:
+host    all             all             ::1/128                 md5
+# Allow replication connections from localhost, by a user with the
+# replication privilege.
+local   replication     all                                     peer
+host    replication     all             127.0.0.1/32            md5
+host    replication     all             ::1/128                 md5
\ No newline at end of file
diff --git a/ansible/roles/keycloak/templates/standalone-ha.xml.j2 b/ansible/roles/keycloak/templates/standalone-ha.xml.j2
deleted file mode 100644
index e6fa3e837..000000000
--- a/ansible/roles/keycloak/templates/standalone-ha.xml.j2
+++ /dev/null
@@ -1,539 +0,0 @@
-<?xml version="1.0" ?>
-
-<server xmlns="urn:jboss:domain:4.0">
-    <extensions>
-        <extension module="org.jboss.as.clustering.infinispan"/>
-        <extension module="org.jboss.as.clustering.jgroups"/>
-        <extension module="org.jboss.as.connector"/>
-        <extension module="org.jboss.as.deployment-scanner"/>
-        <extension module="org.jboss.as.ee"/>
-        <extension module="org.jboss.as.ejb3"/>
-        <extension module="org.jboss.as.jaxrs"/>
-        <extension module="org.jboss.as.jdr"/>
-        <extension module="org.jboss.as.jmx"/>
-        <extension module="org.jboss.as.jpa"/>
-        <extension module="org.jboss.as.jsf"/>
-        <extension module="org.jboss.as.logging"/>
-        <extension module="org.jboss.as.mail"/>
-        <extension module="org.jboss.as.modcluster"/>
-        <extension module="org.jboss.as.naming"/>
-        <extension module="org.jboss.as.remoting"/>
-        <extension module="org.jboss.as.security"/>
-        <extension module="org.jboss.as.transactions"/>
-        <extension module="org.keycloak.keycloak-server-subsystem"/>
-        <extension module="org.wildfly.extension.bean-validation"/>
-        <extension module="org.wildfly.extension.io"/>
-        <extension module="org.wildfly.extension.request-controller"/>
-        <extension module="org.wildfly.extension.security.manager"/>
-        <extension module="org.wildfly.extension.undertow"/>
-    </extensions>
-    <management>
-        <security-realms>
-            <security-realm name="ManagementRealm">
-                <authentication>
-                    <local default-user="$local" skip-group-loading="true"/>
-                    <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
-                </authentication>
-                <authorization map-groups-to-roles="false">
-                    <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
-                </authorization>
-            </security-realm>
-            <security-realm name="ApplicationRealm">
-                <authentication>
-                    <local default-user="$local" allowed-users="*" skip-group-loading="true"/>
-                    <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
-                </authentication>
-                <authorization>
-                    <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
-                </authorization>
-            </security-realm>
-        </security-realms>
-        <audit-log>
-            <formatters>
-                <json-formatter name="json-formatter"/>
-            </formatters>
-            <handlers>
-                <file-handler name="file" formatter="json-formatter" relative-to="jboss.server.data.dir" path="audit-log.log"/>
-            </handlers>
-            <logger log-boot="true" log-read-only="false" enabled="false">
-                <handlers>
-                    <handler name="file"/>
-                </handlers>
-            </logger>
-        </audit-log>
-        <management-interfaces>
-            <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
-                <socket-binding http="management-http"/>
-            </http-interface>
-        </management-interfaces>
-        <access-control provider="simple">
-            <role-mapping>
-                <role name="SuperUser">
-                    <include>
-                        <user name="$local"/>
-                    </include>
-                </role>
-            </role-mapping>
-        </access-control>
-    </management>
-    <profile>
-        <subsystem xmlns="urn:jboss:domain:logging:3.0">
-            <console-handler name="CONSOLE">
-                <level name="INFO"/>
-                <formatter>
-                    <named-formatter name="COLOR-PATTERN"/>
-                </formatter>
-            </console-handler>
-            <periodic-rotating-file-handler name="FILE" autoflush="true">
-                <formatter>
-                    <named-formatter name="PATTERN"/>
-                </formatter>
-                <file relative-to="jboss.server.log.dir" path="server.log"/>
-                <suffix value=".yyyy-MM-dd"/>
-                <append value="true"/>
-            </periodic-rotating-file-handler>
-            <logger category="com.arjuna">
-                <level name="WARN"/>
-            </logger>
-            <logger category="org.jboss.as.config">
-                <level name="DEBUG"/>
-            </logger>
-            <logger category="sun.rmi">
-                <level name="WARN"/>
-            </logger>
-            <root-logger>
-                <level name="INFO"/>
-                <handlers>
-                    <handler name="CONSOLE"/>
-                    <handler name="FILE"/>
-                </handlers>
-            </root-logger>
-            <formatter name="PATTERN">
-                <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
-            </formatter>
-            <formatter name="COLOR-PATTERN">
-                <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
-            </formatter>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:datasources:4.0">
-            <datasources>
-                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
-                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
-                    <driver>h2</driver>
-                    <security>
-                        <user-name>sa</user-name>
-                        <password>sa</password>
-                    </security>
-                </datasource>
-                <datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true">
-                    <connection-url>{{keycloak_db_url}}</connection-url>
-                    <driver>mysql</driver>
-                    <pool>
-                        <max-pool-size>{{keycloak_db_pool_size}}</max-pool-size>
-                    </pool>
-                    <security>
-                        <user-name>{{keycloak_db_username}}</user-name>
-                        <password>{{keycloak_db_password}}</password>
-                    </security>
-                    <validation>
-                        <check-valid-connection-sql>select 1</check-valid-connection-sql>
-                        <validate-on-match>false</validate-on-match>
-                        <background-validation>true</background-validation>
-                        <background-validation-millis>10000</background-validation-millis>
-                    </validation>
-                </datasource>
-                <drivers>
-		            <driver name="mysql" module="org.mysql">
-			            <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
-		            </driver>
-                    <driver name="h2" module="com.h2database.h2">
-                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
-                    </driver>
-                </drivers>
-            </datasources>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
-            <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:ee:4.0">
-            <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
-            <concurrent>
-                <context-services>
-                    <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
-                </context-services>
-                <managed-thread-factories>
-                    <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
-                </managed-thread-factories>
-                <managed-executor-services>
-                    <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
-                </managed-executor-services>
-                <managed-scheduled-executor-services>
-                    <managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
-                </managed-scheduled-executor-services>
-            </concurrent>
-            <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:ejb3:4.0">
-            <session-bean>
-                <stateless>
-                    <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
-                </stateless>
-                <stateful default-access-timeout="5000" cache-ref="distributable" passivation-disabled-cache-ref="simple"/>
-                <singleton default-access-timeout="5000"/>
-            </session-bean>
-            <pools>
-                <bean-instance-pools>
-                    <!-- Automatically configure pools. Alternatively, max-pool-size can be set to a specific value -->
-                    <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
-                    <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
-                </bean-instance-pools>
-            </pools>
-            <caches>
-                <cache name="simple"/>
-                <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
-            </caches>
-            <passivation-stores>
-                <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
-            </passivation-stores>
-            <async thread-pool-name="default"/>
-            <timer-service thread-pool-name="default" default-data-store="default-file-store">
-                <data-stores>
-                    <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
-                </data-stores>
-            </timer-service>
-            <remote connector-ref="http-remoting-connector" thread-pool-name="default"/>
-            <thread-pools>
-                <thread-pool name="default">
-                    <max-threads count="10"/>
-                    <keepalive-time time="100" unit="milliseconds"/>
-                </thread-pool>
-            </thread-pools>
-            <default-security-domain value="other"/>
-            <default-missing-method-permissions-deny-access value="true"/>
-            <log-system-exceptions value="true"/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:io:1.1">
-            <worker name="default"/>
-            <buffer-pool name="default"/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:infinispan:4.0">
-            <cache-container name="keycloak" jndi-name="infinispan/Keycloak">
-                <transport lock-timeout="60000"/>
-                <local-cache name="realms">
-                    <eviction max-entries="10000" strategy="LRU"/>
-                </local-cache>
-                <local-cache name="users">
-                    <eviction max-entries="10000" strategy="LRU"/>
-                </local-cache>
-                <distributed-cache name="sessions" mode="SYNC" owners="1"/>
-                <distributed-cache name="offlineSessions" mode="SYNC" owners="1"/>
-                <distributed-cache name="loginFailures" mode="SYNC" owners="1"/>
-                <distributed-cache name="authorization" mode="SYNC" owners="1"/>
-                <replicated-cache name="work" mode="SYNC"/>
-                <local-cache name="keys">
-                    <eviction max-entries="1000" strategy="LRU"/>
-                    <expiration max-idle="3600000"/>
-                </local-cache>
-            </cache-container>
-            <cache-container name="server" aliases="singleton cluster" default-cache="default" module="org.wildfly.clustering.server">
-                <transport lock-timeout="60000"/>
-                <replicated-cache name="default" mode="SYNC">
-                    <transaction mode="BATCH"/>
-                </replicated-cache>
-            </cache-container>
-            <cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
-                <transport lock-timeout="60000"/>
-                <distributed-cache name="dist" mode="ASYNC" l1-lifespan="0" owners="2">
-                    <locking isolation="REPEATABLE_READ"/>
-                    <transaction mode="BATCH"/>
-                    <file-store/>
-                </distributed-cache>
-            </cache-container>
-            <cache-container name="ejb" aliases="sfsb" default-cache="dist" module="org.wildfly.clustering.ejb.infinispan">
-                <transport lock-timeout="60000"/>
-                <distributed-cache name="dist" mode="ASYNC" l1-lifespan="0" owners="2">
-                    <locking isolation="REPEATABLE_READ"/>
-                    <transaction mode="BATCH"/>
-                    <file-store/>
-                </distributed-cache>
-            </cache-container>
-            <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
-                <transport lock-timeout="60000"/>
-                <local-cache name="local-query">
-                    <eviction strategy="LRU" max-entries="10000"/>
-                    <expiration max-idle="100000"/>
-                </local-cache>
-                <invalidation-cache name="entity" mode="SYNC">
-                    <transaction mode="NON_XA"/>
-                    <eviction strategy="LRU" max-entries="10000"/>
-                    <expiration max-idle="100000"/>
-                </invalidation-cache>
-                <replicated-cache name="timestamps" mode="ASYNC"/>
-            </cache-container>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:jca:4.0">
-            <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
-            <bean-validation enabled="true"/>
-            <default-workmanager>
-                <short-running-threads>
-                    <core-threads count="50"/>
-                    <queue-length count="50"/>
-                    <max-threads count="50"/>
-                    <keepalive-time time="10" unit="seconds"/>
-                </short-running-threads>
-                <long-running-threads>
-                    <core-threads count="50"/>
-                    <queue-length count="50"/>
-                    <max-threads count="50"/>
-                    <keepalive-time time="10" unit="seconds"/>
-                </long-running-threads>
-            </default-workmanager>
-            <cached-connection-manager/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:jgroups:4.0">
-            <channels default="ee">
-                <channel name="ee" stack="udp"/>
-            </channels>
-            <stacks>
-                <stack name="udp">
-                    <transport type="UDP" socket-binding="jgroups-udp"/>
-                    <protocol type="PING"/>
-                    <protocol type="MERGE3"/>
-                    <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
-                    <protocol type="FD_ALL"/>
-                    <protocol type="VERIFY_SUSPECT"/>
-                    <protocol type="pbcast.NAKACK2"/>
-                    <protocol type="UNICAST3"/>
-                    <protocol type="pbcast.STABLE"/>
-                    <protocol type="pbcast.GMS"/>
-                    <protocol type="UFC"/>
-                    <protocol type="MFC"/>
-                    <protocol type="FRAG2"/>
-                </stack>
-                <stack name="tcp">
-                    <transport type="TCP" socket-binding="jgroups-tcp"/>
-                    <protocol type="MPING" socket-binding="jgroups-mping"/>
-                    <protocol type="MERGE3"/>
-                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
-                    <protocol type="FD"/>
-                    <protocol type="VERIFY_SUSPECT"/>
-                    <protocol type="pbcast.NAKACK2"/>
-                    <protocol type="UNICAST3"/>
-                    <protocol type="pbcast.STABLE"/>
-                    <protocol type="pbcast.GMS"/>
-                    <protocol type="MFC"/>
-                    <protocol type="FRAG2"/>
-                </stack>
-            </stacks>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:jmx:1.3">
-            <expose-resolved-model/>
-            <expose-expression-model/>
-            <remoting-connector/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:jpa:1.1">
-            <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:jsf:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:mail:2.0">
-            <mail-session name="default" jndi-name="java:jboss/mail/Default">
-                <smtp-server outbound-socket-binding-ref="mail-smtp"/>
-            </mail-session>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:modcluster:2.0">
-            <mod-cluster-config advertise-socket="modcluster" connector="ajp">
-                <dynamic-load-provider>
-                    <load-metric type="cpu"/>
-                </dynamic-load-provider>
-            </mod-cluster-config>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:naming:2.0">
-            <remote-naming/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:remoting:3.0">
-            <endpoint/>
-            <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:security-manager:1.0">
-            <deployment-permissions>
-                <maximum-set>
-                    <permission class="java.security.AllPermission"/>
-                </maximum-set>
-            </deployment-permissions>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:security:1.2">
-            <security-domains>
-                <security-domain name="other" cache-type="default">
-                    <authentication>
-                        <login-module code="Remoting" flag="optional">
-                            <module-option name="password-stacking" value="useFirstPass"/>
-                        </login-module>
-                        <login-module code="RealmDirect" flag="required">
-                            <module-option name="password-stacking" value="useFirstPass"/>
-                        </login-module>
-                    </authentication>
-                </security-domain>
-                <security-domain name="jboss-web-policy" cache-type="default">
-                    <authorization>
-                        <policy-module code="Delegating" flag="required"/>
-                    </authorization>
-                </security-domain>
-                <security-domain name="jboss-ejb-policy" cache-type="default">
-                    <authorization>
-                        <policy-module code="Delegating" flag="required"/>
-                    </authorization>
-                </security-domain>
-                <security-domain name="jaspitest" cache-type="default">
-                    <authentication-jaspi>
-                        <login-module-stack name="dummy">
-                            <login-module code="Dummy" flag="optional"/>
-                        </login-module-stack>
-                        <auth-module code="Dummy"/>
-                    </authentication-jaspi>
-                </security-domain>
-            </security-domains>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:transactions:3.0">
-            <core-environment>
-                <process-id>
-                    <uuid/>
-                </process-id>
-            </core-environment>
-            <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:undertow:3.0">
-            <buffer-cache name="default"/>
-            <server name="default-server">
-                <ajp-listener name="ajp" socket-binding="ajp"/>
-                <http-listener name="default" socket-binding="http" redirect-socket="https" proxy-address-forwarding="true"/>
-                <host name="default-host" alias="localhost">
-                    <location name="/" handler="welcome-content"/>
-                    <filter-ref name="server-header"/>
-                    <filter-ref name="x-powered-by-header"/>
-                </host>
-            </server>
-            <servlet-container name="default">
-                <jsp-config/>
-                <websockets/>
-            </servlet-container>
-            <handlers>
-                <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
-            </handlers>
-            <filters>
-                <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
-                <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
-            </filters>
-        </subsystem>
-        <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
-            <web-context>auth</web-context>
-            <providers>
-                <provider>classpath:${jboss.home.dir}/providers/*</provider>
-            </providers>
-            <master-realm-name>master</master-realm-name>
-            <scheduled-task-interval>900</scheduled-task-interval>
-            <theme>
-                <staticMaxAge>2592000</staticMaxAge>
-                <cacheThemes>true</cacheThemes>
-                <cacheTemplates>true</cacheTemplates>
-                <dir>${jboss.home.dir}/themes</dir>
-            </theme>
-            <spi name="eventsStore">
-                <default-provider>jpa</default-provider>
-                <provider name="jpa" enabled="true">
-                    <properties>
-                        <property name="exclude-events" value="[&quot;REFRESH_TOKEN&quot;]"/>
-                    </properties>
-                </provider>
-            </spi>
-            <spi name="realm">
-                <default-provider>jpa</default-provider>
-            </spi>
-            <spi name="user">
-                <default-provider>jpa</default-provider>
-            </spi>
-            <spi name="userFederatedStorage">
-                <default-provider>jpa</default-provider>
-            </spi>
-            <spi name="userCache">
-                <provider name="default" enabled="true"/>
-            </spi>
-            <spi name="userSessionPersister">
-                <default-provider>jpa</default-provider>
-            </spi>
-            <spi name="authorizationPersister">
-                <default-provider>jpa</default-provider>
-            </spi>
-            <spi name="timer">
-                <default-provider>basic</default-provider>
-            </spi>
-            <spi name="connectionsHttpClient">
-                <provider name="default" enabled="true"/>
-            </spi>
-            <spi name="connectionsJpa">
-                <provider name="default" enabled="true">
-                    <properties>
-                        <property name="dataSource" value="java:jboss/datasources/KeycloakDS"/>
-                        <property name="initializeEmpty" value="true"/>
-                        <property name="migrationStrategy" value="update"/>
-                        <property name="migrationExport" value="${jboss.home.dir}/keycloak-database-update.sql"/>
-                    </properties>
-                </provider>
-            </spi>
-            <spi name="realmCache">
-                <provider name="default" enabled="true"/>
-            </spi>
-            <spi name="connectionsInfinispan">
-                <default-provider>default</default-provider>
-                <provider name="default" enabled="true">
-                    <properties>
-                        <property name="cacheContainer" value="java:comp/env/infinispan/Keycloak"/>
-                    </properties>
-                </provider>
-            </spi>
-            <spi name="jta-lookup">
-                <default-provider>${keycloak.jta.lookup.provider:jboss}</default-provider>
-                <provider name="jboss" enabled="true"/>
-            </spi>
-            <spi name="publicKeyStorage">
-                <provider name="infinispan" enabled="true">
-                    <properties>
-                        <property name="minTimeBetweenRequests" value="10"/>
-                    </properties>
-                </provider>
-            </spi>
-        </subsystem>
-    </profile>
-    <interfaces>
-        <interface name="management">
-            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
-        </interface>
-        <interface name="public">
-            <inet-address value="${jboss.bind.address:127.0.0.1}"/>
-        </interface>
-        <interface name="private">
-            <inet-address value="${jboss.bind.address.private:127.0.0.1}"/>
-        </interface>
-    </interfaces>
-    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
-        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
-        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
-        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
-        <socket-binding name="http" port="${jboss.http.port:8080}"/>
-        <socket-binding name="https" port="${jboss.https.port:8443}"/>
-        <socket-binding name="jgroups-mping" interface="private" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
-        <socket-binding name="jgroups-tcp" interface="private" port="7600"/>
-        <socket-binding name="jgroups-tcp-fd" interface="private" port="57600"/>
-        <socket-binding name="jgroups-udp" interface="private" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
-        <socket-binding name="jgroups-udp-fd" interface="private" port="54200"/>
-        <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
-        <socket-binding name="txn-recovery-environment" port="4712"/>
-        <socket-binding name="txn-status-manager" port="4713"/>
-        <outbound-socket-binding name="mail-smtp">
-            <remote-destination host="localhost" port="25"/>
-        </outbound-socket-binding>
-    </socket-binding-group>
-</server>
diff --git a/ansible/roles/keycloak/templates/standalone.xml.j2 b/ansible/roles/keycloak/templates/standalone.xml.j2
index 340e5938b..65487a4e7 100644
--- a/ansible/roles/keycloak/templates/standalone.xml.j2
+++ b/ansible/roles/keycloak/templates/standalone.xml.j2
@@ -1,6 +1,6 @@
-<?xml version="1.0" ?>
+<?xml version='1.0' encoding='UTF-8'?>
 
-<server xmlns="urn:jboss:domain:4.0">
+<server xmlns="urn:jboss:domain:10.0">
     <extensions>
         <extension module="org.jboss.as.clustering.infinispan"/>
         <extension module="org.jboss.as.connector"/>
@@ -8,19 +8,23 @@
         <extension module="org.jboss.as.ee"/>
         <extension module="org.jboss.as.ejb3"/>
         <extension module="org.jboss.as.jaxrs"/>
-        <extension module="org.jboss.as.jdr"/>
         <extension module="org.jboss.as.jmx"/>
         <extension module="org.jboss.as.jpa"/>
-        <extension module="org.jboss.as.jsf"/>
         <extension module="org.jboss.as.logging"/>
         <extension module="org.jboss.as.mail"/>
         <extension module="org.jboss.as.naming"/>
         <extension module="org.jboss.as.remoting"/>
         <extension module="org.jboss.as.security"/>
         <extension module="org.jboss.as.transactions"/>
+        <extension module="org.jboss.as.weld"/>
         <extension module="org.keycloak.keycloak-server-subsystem"/>
         <extension module="org.wildfly.extension.bean-validation"/>
+        <extension module="org.wildfly.extension.core-management"/>
+        <extension module="org.wildfly.extension.elytron"/>
         <extension module="org.wildfly.extension.io"/>
+        <extension module="org.wildfly.extension.microprofile.config-smallrye"/>
+        <extension module="org.wildfly.extension.microprofile.health-smallrye"/>
+        <extension module="org.wildfly.extension.microprofile.metrics-smallrye"/>
         <extension module="org.wildfly.extension.request-controller"/>
         <extension module="org.wildfly.extension.security.manager"/>
         <extension module="org.wildfly.extension.undertow"/>
@@ -37,6 +41,13 @@
                 </authorization>
             </security-realm>
             <security-realm name="ApplicationRealm">
+                <server-identities>
+                    <ssl>
+                        <keystore path="application.keystore" relative-to="jboss.server.config.dir"
+                                  keystore-password="password" alias="server" key-password="password"
+                                  generate-self-signed-certificate-host="localhost"/>
+                    </ssl>
+                </server-identities>
                 <authentication>
                     <local default-user="$local" allowed-users="*" skip-group-loading="true"/>
                     <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
@@ -51,7 +62,8 @@
                 <json-formatter name="json-formatter"/>
             </formatters>
             <handlers>
-                <file-handler name="file" formatter="json-formatter" relative-to="jboss.server.data.dir" path="audit-log.log"/>
+                <file-handler name="file" formatter="json-formatter" path="audit-log.log"
+                              relative-to="jboss.server.data.dir"/>
             </handlers>
             <logger log-boot="true" log-read-only="false" enabled="false">
                 <handlers>
@@ -60,7 +72,8 @@
             </logger>
         </audit-log>
         <management-interfaces>
-            <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
+            <http-interface security-realm="ManagementRealm">
+                <http-upgrade enabled="true"/>
                 <socket-binding http="management-http"/>
             </http-interface>
         </management-interfaces>
@@ -75,7 +88,7 @@
         </access-control>
     </management>
     <profile>
-        <subsystem xmlns="urn:jboss:domain:logging:3.0">
+        <subsystem xmlns="urn:jboss:domain:logging:8.0">
             <console-handler name="CONSOLE">
                 <level name="INFO"/>
                 <formatter>
@@ -93,6 +106,9 @@
             <logger category="com.arjuna">
                 <level name="WARN"/>
             </logger>
+            <logger category="io.jaegertracing.Configuration">
+                <level name="WARN"/>
+            </logger>
             <logger category="org.jboss.as.config">
                 <level name="DEBUG"/>
             </logger>
@@ -114,9 +130,12 @@
             </formatter>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:datasources:4.0">
+        <subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
+        <subsystem xmlns="urn:jboss:domain:datasources:5.0">
             <datasources>
-                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
+                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true"
+                            use-java-context="true"
+                            statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
                     <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                     <driver>h2</driver>
                     <security>
@@ -124,7 +143,8 @@
                         <password>sa</password>
                     </security>
                 </datasource>
-                <datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true">
+                <datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true"
+                            use-java-context="true">
                     <connection-url>{{keycloak_db_url}}</connection-url>
                     <driver>postgresql</driver>
                     <pool>
@@ -134,16 +154,10 @@
                         <user-name>{{keycloak_db_username}}</user-name>
                         <password>{{keycloak_db_password}}</password>
                     </security>
-                    <validation>
-                        <check-valid-connection-sql>select 1</check-valid-connection-sql>
-                        <validate-on-match>false</validate-on-match>
-                        <background-validation>true</background-validation>
-                        <background-validation-millis>10000</background-validation-millis>
-                    </validation>
                 </datasource>
                 <drivers>
-                    <driver name="mysql" module="org.mysql">
-                        <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
+                    <driver name="postgresql" module="org.postgresql">
+                        <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
                     </driver>
                     <driver name="h2" module="com.h2database.h2">
                         <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
@@ -152,27 +166,39 @@
             </datasources>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
-            <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
+            <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"
+                                runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:ee:4.0">
             <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
             <concurrent>
                 <context-services>
-                    <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
+                    <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default"
+                                     use-transaction-setup-provider="true"/>
                 </context-services>
                 <managed-thread-factories>
-                    <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
+                    <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default"
+                                            context-service="default"/>
                 </managed-thread-factories>
                 <managed-executor-services>
-                    <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
+                    <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default"
+                                              context-service="default" hung-task-threshold="60000"
+                                              keepalive-time="5000"/>
                 </managed-executor-services>
                 <managed-scheduled-executor-services>
-                    <managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
+                    <managed-scheduled-executor-service name="default"
+                                                        jndi-name="java:jboss/ee/concurrency/scheduler/default"
+                                                        context-service="default" hung-task-threshold="60000"
+                                                        keepalive-time="3000"/>
                 </managed-scheduled-executor-services>
             </concurrent>
-            <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
+            <default-bindings context-service="java:jboss/ee/concurrency/context/default"
+                              datasource="java:jboss/datasources/ExampleDS"
+                              managed-executor-service="java:jboss/ee/concurrency/executor/default"
+                              managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default"
+                              managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:ejb3:4.0">
+        <subsystem xmlns="urn:jboss:domain:ejb3:6.0">
             <session-bean>
                 <stateless>
                     <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
@@ -182,9 +208,10 @@
             </session-bean>
             <pools>
                 <bean-instance-pools>
-                    <!-- Automatically configure pools. Alternatively, max-pool-size can be set to a specific value -->
-                    <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
-                    <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
+                    <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count"
+                                     instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
+                    <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools"
+                                     instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                 </bean-instance-pools>
             </pools>
             <caches>
@@ -197,43 +224,56 @@
             <async thread-pool-name="default"/>
             <timer-service thread-pool-name="default" default-data-store="default-file-store">
                 <data-stores>
-                    <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
+                    <file-data-store name="default-file-store" path="timer-service-data"
+                                     relative-to="jboss.server.data.dir"/>
                 </data-stores>
             </timer-service>
-            <remote connector-ref="http-remoting-connector" thread-pool-name="default"/>
+            <remote connector-ref="http-remoting-connector" thread-pool-name="default">
+                <channel-creation-options>
+                    <option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>
+                </channel-creation-options>
+            </remote>
             <thread-pools>
                 <thread-pool name="default">
                     <max-threads count="10"/>
-                    <keepalive-time time="100" unit="milliseconds"/>
+                    <keepalive-time time="60" unit="seconds"/>
                 </thread-pool>
             </thread-pools>
             <default-security-domain value="other"/>
             <default-missing-method-permissions-deny-access value="true"/>
+            <statistics enabled="${wildfly.ejb3.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
             <log-system-exceptions value="true"/>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:io:1.1">
+        <subsystem xmlns="urn:jboss:domain:io:3.0">
             <worker name="default"/>
             <buffer-pool name="default"/>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:infinispan:4.0">
-            <cache-container name="keycloak" jndi-name="infinispan/Keycloak">
+        <subsystem xmlns="urn:jboss:domain:infinispan:9.0">
+            <cache-container name="keycloak">
                 <local-cache name="realms">
-                    <eviction max-entries="10000" strategy="LRU"/>
+                    <object-memory size="10000"/>
                 </local-cache>
                 <local-cache name="users">
-                    <eviction max-entries="10000" strategy="LRU"/>
+                    <object-memory size="10000"/>
                 </local-cache>
                 <local-cache name="sessions"/>
+                <local-cache name="authenticationSessions"/>
                 <local-cache name="offlineSessions"/>
+                <local-cache name="clientSessions"/>
+                <local-cache name="offlineClientSessions"/>
                 <local-cache name="loginFailures"/>
                 <local-cache name="work"/>
                 <local-cache name="authorization">
-                    <eviction max-entries="100" strategy="LRU"/>
+                    <object-memory size="10000"/>
                 </local-cache>
                 <local-cache name="keys">
-                    <eviction max-entries="1000" strategy="LRU"/>
+                    <object-memory size="1000"/>
                     <expiration max-idle="3600000"/>
                 </local-cache>
+                <local-cache name="actionTokens">
+                    <object-memory size="-1"/>
+                    <expiration max-idle="-1" interval="300000"/>
+                </local-cache>
             </cache-container>
             <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">
                 <local-cache name="default">
@@ -246,39 +286,34 @@
                     <transaction mode="BATCH"/>
                     <file-store passivation="true" purge="false"/>
                 </local-cache>
-                <local-cache name="persistent">
+                <local-cache name="sso">
                     <locking isolation="REPEATABLE_READ"/>
                     <transaction mode="BATCH"/>
-                    <file-store passivation="false" purge="false"/>
                 </local-cache>
+                <local-cache name="routing"/>
             </cache-container>
-            <cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan">
+            <cache-container name="ejb" aliases="sfsb" default-cache="passivation"
+                             module="org.wildfly.clustering.ejb.infinispan">
                 <local-cache name="passivation">
                     <locking isolation="REPEATABLE_READ"/>
                     <transaction mode="BATCH"/>
                     <file-store passivation="true" purge="false"/>
                 </local-cache>
-                <local-cache name="persistent">
-                    <locking isolation="REPEATABLE_READ"/>
-                    <transaction mode="BATCH"/>
-                    <file-store passivation="false" purge="false"/>
-                </local-cache>
             </cache-container>
-            <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan">
+            <cache-container name="hibernate" module="org.infinispan.hibernate-cache">
                 <local-cache name="entity">
-                    <transaction mode="NON_XA"/>
-                    <eviction strategy="LRU" max-entries="10000"/>
+                    <object-memory size="10000"/>
                     <expiration max-idle="100000"/>
                 </local-cache>
                 <local-cache name="local-query">
-                    <eviction strategy="LRU" max-entries="10000"/>
+                    <object-memory size="10000"/>
                     <expiration max-idle="100000"/>
                 </local-cache>
                 <local-cache name="timestamps"/>
             </cache-container>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:jca:4.0">
+        <subsystem xmlns="urn:jboss:domain:jca:5.0">
             <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
             <bean-validation enabled="true"/>
             <default-workmanager>
@@ -297,7 +332,6 @@
             </default-workmanager>
             <cached-connection-manager/>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
         <subsystem xmlns="urn:jboss:domain:jmx:1.3">
             <expose-resolved-model/>
             <expose-expression-model/>
@@ -306,8 +340,7 @@
         <subsystem xmlns="urn:jboss:domain:jpa:1.1">
             <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:jsf:1.0"/>
-        <subsystem xmlns="urn:jboss:domain:mail:2.0">
+        <subsystem xmlns="urn:jboss:domain:mail:3.0">
             <mail-session name="default" jndi-name="java:jboss/mail/Default">
                 <smtp-server outbound-socket-binding-ref="mail-smtp"/>
             </mail-session>
@@ -315,8 +348,7 @@
         <subsystem xmlns="urn:jboss:domain:naming:2.0">
             <remote-naming/>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:remoting:3.0">
-            <endpoint/>
+        <subsystem xmlns="urn:jboss:domain:remoting:4.0">
             <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
@@ -327,7 +359,117 @@
                 </maximum-set>
             </deployment-permissions>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:security:1.2">
+        <subsystem xmlns="urn:wildfly:elytron:8.0" final-providers="combined-providers"
+                   disallowed-providers="OracleUcrypto">
+            <providers>
+                <aggregate-providers name="combined-providers">
+                    <providers name="elytron"/>
+                    <providers name="openssl"/>
+                </aggregate-providers>
+                <provider-loader name="elytron" module="org.wildfly.security.elytron"/>
+                <provider-loader name="openssl" module="org.wildfly.openssl"/>
+            </providers>
+            <audit-logging>
+                <file-audit-log name="local-audit" path="audit.log" relative-to="jboss.server.log.dir" format="JSON"/>
+            </audit-logging>
+            <security-domains>
+                <security-domain name="ApplicationDomain" default-realm="ApplicationRealm"
+                                 permission-mapper="default-permission-mapper">
+                    <realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
+                    <realm name="local"/>
+                </security-domain>
+                <security-domain name="ManagementDomain" default-realm="ManagementRealm"
+                                 permission-mapper="default-permission-mapper">
+                    <realm name="ManagementRealm" role-decoder="groups-to-roles"/>
+                    <realm name="local" role-mapper="super-user-mapper"/>
+                </security-domain>
+            </security-domains>
+            <security-realms>
+                <identity-realm name="local" identity="$local"/>
+                <properties-realm name="ApplicationRealm">
+                    <users-properties path="application-users.properties" relative-to="jboss.server.config.dir"
+                                      digest-realm-name="ApplicationRealm"/>
+                    <groups-properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
+                </properties-realm>
+                <properties-realm name="ManagementRealm">
+                    <users-properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"
+                                      digest-realm-name="ManagementRealm"/>
+                    <groups-properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
+                </properties-realm>
+            </security-realms>
+            <mappers>
+                <simple-permission-mapper name="default-permission-mapper" mapping-mode="first">
+                    <permission-mapping>
+                        <principal name="anonymous"/>
+                        <permission-set name="default-permissions"/>
+                    </permission-mapping>
+                    <permission-mapping match-all="true">
+                        <permission-set name="login-permission"/>
+                        <permission-set name="default-permissions"/>
+                    </permission-mapping>
+                </simple-permission-mapper>
+                <constant-realm-mapper name="local" realm-name="local"/>
+                <simple-role-decoder name="groups-to-roles" attribute="groups"/>
+                <constant-role-mapper name="super-user-mapper">
+                    <role name="SuperUser"/>
+                </constant-role-mapper>
+            </mappers>
+            <permission-sets>
+                <permission-set name="login-permission">
+                    <permission class-name="org.wildfly.security.auth.permission.LoginPermission"/>
+                </permission-set>
+                <permission-set name="default-permissions">
+                    <permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission"
+                                module="org.wildfly.extension.batch.jberet" target-name="*"/>
+                    <permission class-name="org.wildfly.transaction.client.RemoteTransactionPermission"
+                                module="org.wildfly.transaction.client"/>
+                    <permission class-name="org.jboss.ejb.client.RemoteEJBPermission" module="org.jboss.ejb-client"/>
+                </permission-set>
+            </permission-sets>
+            <http>
+                <http-authentication-factory name="management-http-authentication" security-domain="ManagementDomain"
+                                             http-server-mechanism-factory="global">
+                    <mechanism-configuration>
+                        <mechanism mechanism-name="DIGEST">
+                            <mechanism-realm realm-name="ManagementRealm"/>
+                        </mechanism>
+                    </mechanism-configuration>
+                </http-authentication-factory>
+                <provider-http-server-mechanism-factory name="global"/>
+            </http>
+            <sasl>
+                <sasl-authentication-factory name="application-sasl-authentication" sasl-server-factory="configured"
+                                             security-domain="ApplicationDomain">
+                    <mechanism-configuration>
+                        <mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
+                        <mechanism mechanism-name="DIGEST-MD5">
+                            <mechanism-realm realm-name="ApplicationRealm"/>
+                        </mechanism>
+                    </mechanism-configuration>
+                </sasl-authentication-factory>
+                <sasl-authentication-factory name="management-sasl-authentication" sasl-server-factory="configured"
+                                             security-domain="ManagementDomain">
+                    <mechanism-configuration>
+                        <mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
+                        <mechanism mechanism-name="DIGEST-MD5">
+                            <mechanism-realm realm-name="ManagementRealm"/>
+                        </mechanism>
+                    </mechanism-configuration>
+                </sasl-authentication-factory>
+                <configurable-sasl-server-factory name="configured" sasl-server-factory="elytron">
+                    <properties>
+                        <property name="wildfly.sasl.local-user.default-user" value="$local"/>
+                    </properties>
+                </configurable-sasl-server-factory>
+                <mechanism-provider-filtering-sasl-server-factory name="elytron" sasl-server-factory="global">
+                    <filters>
+                        <filter provider-name="WildFlyElytron"/>
+                    </filters>
+                </mechanism-provider-filtering-sasl-server-factory>
+                <provider-sasl-server-factory name="global"/>
+            </sasl>
+        </subsystem>
+        <subsystem xmlns="urn:jboss:domain:security:2.0">
             <security-domains>
                 <security-domain name="other" cache-type="default">
                     <authentication>
@@ -344,11 +486,6 @@
                         <policy-module code="Delegating" flag="required"/>
                     </authorization>
                 </security-domain>
-                <security-domain name="jboss-ejb-policy" cache-type="default">
-                    <authorization>
-                        <policy-module code="Delegating" flag="required"/>
-                    </authorization>
-                </security-domain>
                 <security-domain name="jaspitest" cache-type="default">
                     <authentication-jaspi>
                         <login-module-stack name="dummy">
@@ -357,26 +494,44 @@
                         <auth-module code="Dummy"/>
                     </authentication-jaspi>
                 </security-domain>
+                <security-domain name="jboss-ejb-policy" cache-type="default">
+                    <authorization>
+                        <policy-module code="Delegating" flag="required"/>
+                    </authorization>
+                </security-domain>
             </security-domains>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:transactions:3.0">
-            <core-environment>
+        <subsystem xmlns="urn:jboss:domain:transactions:5.0">
+            <core-environment node-identifier="${jboss.tx.node.id:1}">
                 <process-id>
                     <uuid/>
                 </process-id>
             </core-environment>
             <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
+            <coordinator-environment
+                    statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
+            <object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
         </subsystem>
-        <subsystem xmlns="urn:jboss:domain:undertow:3.0">
+        <subsystem xmlns="urn:jboss:domain:weld:4.0"/>
+        <subsystem xmlns="urn:wildfly:microprofile-config-smallrye:1.0"/>
+        <subsystem xmlns="urn:wildfly:microprofile-health-smallrye:2.0" security-enabled="false"
+                   empty-liveness-checks-status="${env.MP_HEALTH_EMPTY_LIVENESS_CHECKS_STATUS:UP}"
+                   empty-readiness-checks-status="${env.MP_HEALTH_EMPTY_READINESS_CHECKS_STATUS:UP}"/>
+        <subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" security-enabled="false" exposed-subsystems="*"
+                   prefix="${wildfly.metrics.prefix:wildfly}"/>
+        <subsystem xmlns="urn:jboss:domain:undertow:10.0" default-server="default-server"
+                   default-virtual-host="default-host" default-servlet-container="default"
+                   default-security-domain="other"
+                   statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
             <buffer-cache name="default"/>
             <server name="default-server">
-                <http-listener name="default" socket-binding="http" redirect-socket="proxy-https" proxy-address-forwarding="true"/>
-                <!-- <http-listener name="default" socket-binding="http" redirect-socket="https"/> -->
-                <!-- <https-listener name="https" socket-binding="https" security-realm="UndertowRealm"/> -->
+                <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"
+                               proxy-address-forwarding="true"/>
+                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm"
+                                enable-http2="true"/>
                 <host name="default-host" alias="localhost">
                     <location name="/" handler="welcome-content"/>
-                    <filter-ref name="server-header"/>
-                    <filter-ref name="x-powered-by-header"/>
+                    <http-invoker security-realm="ApplicationRealm"/>
                 </host>
             </server>
             <servlet-container name="default">
@@ -386,10 +541,6 @@
             <handlers>
                 <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
             </handlers>
-            <filters>
-                <response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
-                <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
-            </filters>
         </subsystem>
         <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
             <web-context>auth</web-context>
@@ -405,31 +556,18 @@
                 <dir>${jboss.home.dir}/themes</dir>
             </theme>
             <spi name="eventsStore">
-                <default-provider>jpa</default-provider>
                 <provider name="jpa" enabled="true">
                     <properties>
                         <property name="exclude-events" value="[&quot;REFRESH_TOKEN&quot;]"/>
                     </properties>
                 </provider>
             </spi>
-            <spi name="realm">
-                <default-provider>jpa</default-provider>
-            </spi>
-            <spi name="user">
-                <default-provider>jpa</default-provider>
-            </spi>
-            <spi name="userFederatedStorage">
-                <default-provider>jpa</default-provider>
-            </spi>
             <spi name="userCache">
                 <provider name="default" enabled="true"/>
             </spi>
             <spi name="userSessionPersister">
                 <default-provider>jpa</default-provider>
             </spi>
-            <spi name="authorizationPersister">
-                <default-provider>jpa</default-provider>
-            </spi>
             <spi name="timer">
                 <default-provider>basic</default-provider>
             </spi>
@@ -453,7 +591,7 @@
                 <default-provider>default</default-provider>
                 <provider name="default" enabled="true">
                     <properties>
-                        <property name="cacheContainer" value="java:comp/env/infinispan/Keycloak"/>
+                        <property name="cacheContainer" value="java:jboss/infinispan/container/keycloak"/>
                     </properties>
                 </provider>
             </spi>
@@ -468,6 +606,19 @@
                     </properties>
                 </provider>
             </spi>
+            <spi name="x509cert-lookup">
+                <default-provider>${keycloak.x509cert.lookup.provider:default}</default-provider>
+                <provider name="default" enabled="true"/>
+            </spi>
+            <spi name="hostname">
+                <default-provider>default</default-provider>
+                <provider name="default" enabled="true">
+                    <properties>
+                        <property name="frontendUrl" value="${keycloak.frontendUrl:}"/>
+                        <property name="forceBackendUrlToFrontendUrl" value="false"/>
+                    </properties>
+                </provider>
+            </spi>
         </subsystem>
     </profile>
     <interfaces>
@@ -478,13 +629,13 @@
             <inet-address value="${jboss.bind.address:127.0.0.1}"/>
         </interface>
     </interfaces>
-    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
-        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
-        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
+    <socket-binding-group name="standard-sockets" default-interface="public"
+                          port-offset="${jboss.socket.binding.port-offset:0}">
         <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
         <socket-binding name="http" port="${jboss.http.port:8080}"/>
-        <!-- <socket-binding name="https" port="${jboss.https.port:8443}"/> -->
-        <socket-binding name="proxy-https" port="443"/>
+        <socket-binding name="https" port="${jboss.https.port:8443}"/>
+        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
+        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
         <socket-binding name="txn-recovery-environment" port="4712"/>
         <socket-binding name="txn-status-manager" port="4713"/>
         <outbound-socket-binding name="mail-smtp">
diff --git a/ansible/roles/migrate_db/tasks/main.yml b/ansible/roles/migrate_db/tasks/main.yml
index 5904c2d92..db6ae4465 100644
--- a/ansible/roles/migrate_db/tasks/main.yml
+++ b/ansible/roles/migrate_db/tasks/main.yml
@@ -19,8 +19,23 @@
 #
 
 ---
-- name: Copy dump file from old server to master node
+- name: Copy mysql dump file from old server to master node
   fetch:
     src: /home/ubuntu/temp_backup/core_services_server_db_arch.sql
     dest: tmp/
-    flat: yes
\ No newline at end of file
+    flat: yes
+  when: inventory_hostname == 'old_custos'
+
+- name: Copy postgresql dump file from old server to master node
+  fetch:
+    src: /home/ubuntu/temp_backup/postgresDB_arch.sql
+    dest: tmp/
+    flat: yes
+  when: inventory_hostname == 'old_keycloak'
+
+- name: Copy consul dump file from old server to master node
+  fetch:
+    src: /home/ubuntu/temp_backup/primary.snap
+    dest: tmp/
+    flat: yes
+  when: inventory_hostname == 'old_hashicorp'
diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml
index 895623cc1..914a49bcf 100644
--- a/ansible/roles/nginx/tasks/main.yml
+++ b/ansible/roles/nginx/tasks/main.yml
@@ -24,12 +24,14 @@
     update_cache: yes
     cache_valid_time: 86400
   become: yes
+  tags: env_setup
 
 - name: install nginx
   apt:
     name: nginx
     state: latest
   become: yes
+  tags: env_setup
 
 - name: allow OpenSSH
   ufw:
@@ -37,6 +39,7 @@
     name: "OpenSSH"
     state: enabled
   become: yes
+  tags: env_setup
 
 # It is recommended to enable the most restrictive profile
 #  that will still allow the traffic you’ve configured.
@@ -45,10 +48,9 @@
   ufw:
     rule: allow
     name: "Nginx HTTP"
-#    delete: yes
     state: enabled # enable the ufw rule
   become: yes
-
+  tags: env_setup
 
 - name: create www directory at "/var/www/{{ ansible_host }}"
   file:
@@ -58,14 +60,7 @@
     owner: "{{ user }}"
     group: "{{ group }}"
   become: yes
-
-
-- name: delete default nginx config
-  file:
-    path: /etc/nginx/sites-enabled/default
-    state: absent
-  become: yes
-
+  tags: env_setup
 
 - name: copy sample index.html from {{ inventory_hostname }} to /var/www/{{ ansible_host }}/html
   template: >
@@ -74,17 +69,34 @@
     owner="{{ user }}"
     group="{{ group }}"
     mode="u=rw,g=r,o=r"
+  tags: env_setup
 
+- name: delete default nginx config
+  file:
+    path: /etc/nginx/sites-enabled/default
+    state: absent
+  become: yes
+  tags: env_setup
 
 - name: copy nginx site.conf
   template:
-    src: "{{ inventory_hostname }}/site.conf.j2"
+    src: "{{ inventory_hostname }}/envsetup_site.conf.j2"
     dest: /etc/nginx/sites-available/{{ ansible_host }}
     owner: root
     group: root
     mode: '0644'
   become: yes
+  tags: env_setup
 
+- name: copy nginx site.conf
+  template:
+    src: "{{ inventory_hostname }}/site.conf.j2"
+    dest: /etc/nginx/sites-available/{{ ansible_host }}
+    owner: root
+    group: root
+    mode: '0644'
+  become: yes
+#  tags: env_setup
 
 - name: link sample html to sites-enabled directory
   file:
@@ -92,7 +104,7 @@
     dest: /etc/nginx/sites-enabled/{{ ansible_host }}
     state: link
   become: yes
-
+  tags: env_setup
 
 - name: adjust server_names_hash_bucket_size
   template: >
@@ -102,7 +114,7 @@
     group="{{ group }}"
     mode="u=rw,g=r,o=r"
   become: yes
-
+#  tags: env_setup
 
 - name: allow HTTPS traffic
   ufw:
@@ -110,7 +122,7 @@
     name: "Nginx Full"
     state: enabled # enable the ufw rule
   become: yes
-
+  tags: env_setup
 
 - name: delete redundant Nginx HTTP
   ufw:
@@ -119,12 +131,14 @@
     delete: yes
     state: enabled # enable the ufw rule
   become: yes
+  tags: env_setup
 
 - name: Restart nginx
   service:
     name: nginx
     state: restarted
   become: yes
+  tags: env_setup
 
 - name: install certbot
   apt:
@@ -133,4 +147,11 @@
       - python3-certbot-nginx
     state: latest
   become: yes
+  tags: env_setup
 
+- name: Create certs directory
+  ansible.builtin.file:
+    path: "{{ user_home }}/certs"
+    state: directory
+    mode: '0755'
+  tags: env_setup
diff --git a/ansible/roles/nginx/templates/custos/envsetup_site.conf.j2 b/ansible/roles/nginx/templates/custos/envsetup_site.conf.j2
new file mode 100644
index 000000000..53fa29b1b
--- /dev/null
+++ b/ansible/roles/nginx/templates/custos/envsetup_site.conf.j2
@@ -0,0 +1,11 @@
+server {
+  listen 80;
+  listen [::]:80;
+
+  root /var/www/{{ ansible_host }}/html;
+  index index.html index.htm index.nginx-debian.html;
+  server_name {{ ansible_host }} www.{{ ansible_host }};
+  location / {
+    try_files $uri $uri/ =404;
+  }
+}
\ No newline at end of file
diff --git a/ansible/roles/nginx/templates/hashicorp/envsetup_site.conf.j2 b/ansible/roles/nginx/templates/hashicorp/envsetup_site.conf.j2
new file mode 100644
index 000000000..53fa29b1b
--- /dev/null
+++ b/ansible/roles/nginx/templates/hashicorp/envsetup_site.conf.j2
@@ -0,0 +1,11 @@
+server {
+  listen 80;
+  listen [::]:80;
+
+  root /var/www/{{ ansible_host }}/html;
+  index index.html index.htm index.nginx-debian.html;
+  server_name {{ ansible_host }} www.{{ ansible_host }};
+  location / {
+    try_files $uri $uri/ =404;
+  }
+}
\ No newline at end of file
diff --git a/ansible/roles/nginx/templates/hashicorp/index.html.j2 b/ansible/roles/nginx/templates/hashicorp/index.html.j2
index da5a6b58a..a557e65cd 100644
--- a/ansible/roles/nginx/templates/hashicorp/index.html.j2
+++ b/ansible/roles/nginx/templates/hashicorp/index.html.j2
@@ -1,8 +1,8 @@
 <html>
     <head>
-        <title>Welcome to your_domain!</title>
+        <title>Welcome to {{ inventory_hostname }}!</title>
     </head>
     <body>
-        <h1>Success!  The your_domain server block is working!</h1>
+        <h1>Success!  The {{ inventory_hostname }} server block is working!</h1>
     </body>
 </html>
\ No newline at end of file
diff --git a/ansible/roles/nginx/templates/hashicorp/site.conf.j2 b/ansible/roles/nginx/templates/hashicorp/site.conf.j2
index 3386e504a..a76add09b 100644
--- a/ansible/roles/nginx/templates/hashicorp/site.conf.j2
+++ b/ansible/roles/nginx/templates/hashicorp/site.conf.j2
@@ -6,7 +6,7 @@ server {
   ssl_certificate /etc/letsencrypt/live/{{ ansible_host }}/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/{{ ansible_host }}/privkey.pem;
 
-  root /var/www/{{ ansible_hostname }}/html;
+  root /var/www/{{ ansible_host }}/html;
   index index.html index.htm index.nginx-debian.html;
   server_name {{ ansible_host }} www.{{ ansible_host }};
   location / {
diff --git a/ansible/roles/nginx/templates/keycloak/envsetup_site.conf.j2 b/ansible/roles/nginx/templates/keycloak/envsetup_site.conf.j2
new file mode 100644
index 000000000..299c12429
--- /dev/null
+++ b/ansible/roles/nginx/templates/keycloak/envsetup_site.conf.j2
@@ -0,0 +1,8 @@
+upstream keycloak {
+  server localhost:8080 ;
+}
+server {
+   listen 80;
+   server_name bm-dev-2.usecustos.org;
+   return 301 https://bm-dev-2.usecustos.org$request_uri;
+}
\ No newline at end of file
diff --git a/ansible/roles/vault/tasks/main.yml b/ansible/roles/vault/tasks/main.yml
index 15061bfeb..46eddea54 100644
--- a/ansible/roles/vault/tasks/main.yml
+++ b/ansible/roles/vault/tasks/main.yml
@@ -52,4 +52,20 @@
   ansible.builtin.service:
     name: vault
     state: restarted
-  become: yes
\ No newline at end of file
+  become: yes
+
+- name: Copy vault.conf to /etc/nginx/conf.d
+  template:
+    src: vault.conf.j2
+    dest: /etc/nginx/conf.d/vault.conf
+    owner: root
+    group: root
+    mode: '0644'
+  become: yes
+
+- name: Restart nginx
+  service:
+    name: nginx
+    state: restarted
+  become: yes
+  tags: env_setup
\ No newline at end of file
diff --git a/ansible/roles/vault/templates/vault.conf.j2 b/ansible/roles/vault/templates/vault.conf.j2
new file mode 100644
index 000000000..2fec045b1
--- /dev/null
+++ b/ansible/roles/vault/templates/vault.conf.j2
@@ -0,0 +1,37 @@
+upstream vault {
+  server 127.0.0.1:8200;
+}
+server {
+   listen 80;
+   server_name {{ ansible_host }};
+   return 301 https://{{ ansible_host }}$request_uri;
+ }
+
+server {
+    listen 443 ssl;
+
+    # The host name to respond to
+    server_name        {{ ansible_host }};
+    ssl_certificate    /etc/letsencrypt/live/{{ ansible_host }}/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/{{ ansible_host }}/privkey.pem;
+    ssl_prefer_server_ciphers on;
+
+    add_header 'Access-Control-Allow-Origin' '*' always;
+    add_header 'Access-Control-Allow_Credentials' 'true';
+    add_header 'Access-Control-Allow-Headers' 'Authorization,authorization, Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,user-token';
+    add_header  'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
+    rewrite_log on;
+    error_log   /var/log/nginx/error.log;
+
+ location /{
+    proxy_set_header Host $host;
+    proxy_set_header X-Real-IP $remote_addr;
+    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    proxy_set_header X-Forwarded-Proto https;
+    proxy_set_header X-Forwarded-Host $server_name;
+    proxy_pass         http://vault;
+    add_header Strict-Transport-Security "max-age=31536000" always;
+    add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
+}
+
+}
\ No newline at end of file
diff --git a/ansible/roles/vault/templates/vault.hcl.j2 b/ansible/roles/vault/templates/vault.hcl.j2
index c9507f206..06054c34b 100644
--- a/ansible/roles/vault/templates/vault.hcl.j2
+++ b/ansible/roles/vault/templates/vault.hcl.j2
@@ -11,21 +11,23 @@ ui = true
 
 storage "consul" {
   address = "127.0.0.1:8500"
-  path    = "vault"
+  path    = "vault/"
 }
 
 # HTTP listener
-#listener "tcp" {
-#  address = "127.0.0.1:8200"
-#  tls_disable = 1
-#}
+listener "tcp" {
+  address = "127.0.0.1:8200"
+  tls_disable = 1
+  tls_cert_file = "/etc/letsencrypt/live/bm-dev-3.usecustos.org/fullchain.pem"
+  tls_key_file = "/etc/letsencrypt/live/bm-dev-3.usecustos.org/privkey.pem"
+}
 
 # HTTPS listener
-listener "tcp" {
-  address       = "0.0.0.0:8200"
+#listener "tcp" {
+#  address       = "0.0.0.0:8200"
 #  tls_cert_file = "/opt/vault/tls/tls.crt"
-  #tls_key_file  = "/opt/vault/tls/tls.key"
-}
+#  tls_key_file  = "/opt/vault/tls/tls.key"
+#}
 
 # Enterprise license_path
 # This will be required for enterprise as of v1.8
diff --git a/ansible/vault_pass b/ansible/vault_pass
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/ansible/vault_pass
@@ -0,0 +1,1 @@
+


Test patch:
diff --git a/ansible/inventories/test/group_vars/all/vars.yml b/ansible/inventories/test/group_vars/all/vars.yml
index 4a601976a..c855cc73f 100644
--- a/ansible/inventories/test/group_vars/all/vars.yml
+++ b/ansible/inventories/test/group_vars/all/vars.yml
@@ -56,6 +56,7 @@ letsencrypt_email: "abhinav7sinha@gmail.com"
 keycloak_vhost_servername: "{{ hostvars['keycloak'].ansible_host }}"
 keycloak_repo: https://github.com/keycloak/keycloak.git
 keycloak_source_dir: "{{ user_home }}/keycloak-source"
+keycloak_deployment_dir: "{{ user_home }}/keycloak-9.0.2"
 
 # Database related variables
 db_name: core_services_server_db
diff --git a/ansible/inventories/test/group_vars/all/vault.yml b/ansible/inventories/test/group_vars/all/vault.yml
index 6b5e02610..da667cf1e 100644
--- a/ansible/inventories/test/group_vars/all/vault.yml
+++ b/ansible/inventories/test/group_vars/all/vault.yml
@@ -1,338 +1,346 @@
 $ANSIBLE_VAULT;1.1;AES256
-36313830616136383364626539333738663035363431303837636437343762633332343163366261
-3164386230623566396439336137343061363230383331660a346336393132643762636164643033
-34653537383835653039643863363561313563646661666364636133306136656239623566623133
-6133313033376339330a616338623062633463306138373939656638333833663432666262383432
-66313232376538356134323736353033346164336531306132303061323466323436396532646361
-30643763323830663237643138636137376266343566323561666432623965323534356133343537
-38653261396664343835346161653533373234363836646236653933343632666430363238343637
-39386135643664366336613134393939653639393437613663613334316463626366303563616335
-32313034613235343665666664623136353964663665633932636362643334653963353732643038
-30393332383230326664373936636237626166303565626438393236663066303935356238653833
-36633234336266343236353262313266643134333230396530386161313662373134356439303333
-37373639376365663135623337353133353036616535323531313265653633333536376137633131
-32326239336439613930386632633739363666663030313832626361323536336235346232326437
-64336139666335306337626530626164326335623933323162666631393833306638366538633965
-35343063373865303964333863313935316632356461303463326339333366633533643538353266
-62333232383839616366623831366666376261623961376335623338373331333962373463663733
-64363736646430663732353238383261373130653134613963323761306264663938353132333661
-65303135613238353766313835643739313063623363343662616130393934626236373930656562
-63623936353537636561653937653961343166653431396538643932623136326233333831623935
-61313534303365633563646237356532336163343536356466376634353262383830663462316161
-34326431663961363137303036633030663865366539356237633766316436373235636161633536
-62353433316164633338373830346336303862376564636261306261343961353535356531376234
-31353335313032653036306336363162396331326465323031303261653464636136613365656531
-37346435396133363739336332376464616562386334376663336630323562313930383536356134
-32646262366338323833386231353737306465323735653631373435653061663433373964393634
-63616231386437336335663364306135353635653234383430316432616362396132646338313936
-39613963646331326337633063343334333738303935353536383838353961386265633266646463
-62316234373531383232313232643465663539363139346366663565313061643862633464356637
-36303332393830356666346162643065626633346365323338393537333865396666366434623465
-36646630333836383964346634623537316234356462663533376433326639343339646166333231
-32393532383763373938343962616631306332383866646536646231623333353235653130336631
-31363265663565383362306431333964636230356531323830356164666636653363383066353135
-33633135343233626539393963366437323736333762363730306366353162383334383338396664
-35636438626437336264313461356233636561313265393133666231616232623731646363633930
-39383737653137393939306338316639613434643666626132363734376235303437376333363835
-64383866373761333165616134363762646535393534613062373363373934373639373964366533
-61303563636230336665646339663435333165336135313931303538373436643066393737313536
-33336536343665666432373630633935323634313337636264303163393331363633366439313037
-36653661343339623164666161376533306632386665326431663865653532323532356464663363
-39326138316532636631616532643131363636656538313439633434333435346433303262373838
-64666536653533636166656363373630336530306264353836356636646538633266323437633437
-65383134363963316364313538373762386432323665376262323931386639306330643661373131
-62656563396435366536663934636531613061316465363237313434383665323634303632663066
-62336366353865333962396534663034333138383164336433623437333235313938663332623863
-33643966643435306361636336366539343630376232646566366331383135313463323438653631
-65333363383535626238353631333536333939653930316235306437313231313566633437613136
-66643433636636663739313064313239646265333734373132333939616239353066313562343932
-36386637663063303136386534303061383234623235353235666265306631363166333031663661
-36663561383363303032396561636561633932646338633937326331323138323737393135343366
-30656136323133636465393536333535303161303831333830313561373731613338626630336139
-34313062363531303036653936653534626366353038386630613565393936363038323432626433
-64616437626666366463663838666232653464663136323132343830666262383835633063666465
-36353265336534643962653766346164366139353731636466343438353132623337666237313938
-38643332663237393633666366383535336163386436353162656531376234393031636464363161
-37396162353738386362656230376564323063396333386630323838633661373466356464326438
-64613566333163336665633034323438336562626166643662316232643438383132666465343136
-39613636653834363930643234396632643933303030626662646263633830386330303537613134
-61643638643037396464323634336132366665346236383839323561343835363662373436313963
-34396234616439396430363866626165666331373439343761666665663161313436616161653166
-63356335353036356565643538636337356364333363353538656462613965373162363031363432
-61386631356135316536623661333334396265353734653332633131616261366637643634353736
-64303232356231336162656266333539313832396139323830623161313239326462613538316466
-38303963333433336131313063393936333332363636636536333764626261336139323032613134
-35346565323766396361363232326330393137363762656534313834326232336533313965303339
-31633964616139383731373362383164633033626665363132626235376461613739306131316533
-34336230323961316431306135373435346638383461646333663962366464396639623062613337
-39353762356635306630386664393539613537373064386432386265633061383039386661653133
-39626565353164336661363162336663656334613538353764303564373233666366653036323162
-64666533656564333136646561343030613938396438393030313161303662353363343133613939
-66326330653339636531313332646563313334343264313063363366666634353263653632306535
-33393664353363383338333638633564353733646137303739393631636261346363373537646537
-30653561373665396330626566313864356566353661623863626334643536356162616362373532
-31336537376639646535323461323933333734386233323634633530353031626662303039333166
-64346461373034393033363064383331346230383331306135393936343231616634643966653930
-65653333393937303336666631313535373936666565616363303938366131353038653530666232
-66643839636239373837393931346234323764616232633736633936316432326230663663646339
-30376139393235323838306161383038636262623435353661643465376161633365616233636538
-39313961353838316236626232623565343562393538656163333739646432643166666233633764
-30306332356136373538616366316638643737626333626563643934376131376338643962363361
-34623131643762363564313534376535326265623435303131323563373464663139313638653435
-61383038323130393230333137323639346166356461613962356136663466316661303361306533
-61383037656338313663656561353030376461303933326132353161633130663366356562366637
-65393339326335363234393838643161323430653261356639333833623934613130336264356533
-62383866393330333264613631333936353630656663323639303366393865373631666662663934
-31376265303235346463326139666139313962323461313262323936343532613163346365653136
-63616434633136313665666131383765323131386533396264373562313963333261663539663166
-66373063646531353961343062613630333862363965376163633130653364386332663066313332
-63306566643666336531383339373364623930626465653030366666356666333430383631383536
-38313835373933393134363166356137653565643439613734333737313866323565656535633733
-63343438393461303139616233373663633336663466383035353339316464613463303362313961
-32303661373638666236663933653030323262363830643530626366353165363935373532363133
-36333330616639393030373238633638346462653331316539303032343764656630626534643239
-39623634303832633533333330643437383366613935366665646636363266313063373036323634
-61343861316238636361316230366232656532303733333162363265303338393934383430353662
-66616234393837393466636536346330326663383134636165353133313433333738373734336163
-61353232323165643732653838366265633635336632333866353364333665636266366638313936
-38393361353432363864373536326461386634633462333737643431353539396665393434643232
-66376431353838386461383664313234353830326632663666646237323837353438393165383230
-66646433626163356265633030343439383061396134393535313836373262616633363835386536
-62306532633231646336343834663233333038643834333236356438376337326165353533366462
-64353361663661343061643666356563353738613561326539373835643632616437313763623463
-30353864356165653538323134636432383639643439666365616436303530396266323434653435
-31326634633865626332623762623138323039643536636235376662363963636164313563333461
-35376535636662633836336563396664656364663862326265656238306161663238376162373230
-31363932353634363733326364633439313836336632636163393131313137656466623736643163
-33633837343331373732333363346432656139333934323032373936336132636139316337313133
-64656466356265653265663636663335626130633636613263633730353162326265333232323132
-30396634303065323465396265643538363834613361663130643861626130376337353332373265
-31643038373330323936363832623865623938383735366233396161636232363065356333343738
-30663238653738393434316561313736656261313366326531353632653231646533333537363865
-66633931666665383132643837303831643433616366616333633733336666323630336438363962
-66363032396636626437386636626630626139323638623162633138656336356432613737326331
-39386636626534653531376332333361363632323365343661646233646365333935306637643438
-35616634393062323439343333326464636663363230386532353634343066393531376662386466
-31336337323265363931633830356631623137616664383633376535313161613435616431366332
-31333061653364323934613163356263376136616131373165346637356635326464393862373337
-65336435616439323239316365656339333436353065626538333263356330306137336335323638
-38613733336365343336336338626236316166383330323334616362323935383636663336313636
-34383136643239353435336633313834646439613466356666326332613762393937343862336363
-31356533343138653033636664323231663032373036613561613066623862613137663866376230
-64646438363930373533663937386333663565616630633431613632363538343266646163353866
-65646261616636653561326432666437376336363039376133613565323661343537373665396536
-64663438623661343362636530316538346337316665326335656131656633363466333962663134
-64353937656564656237653735663731616232666266343761663137643430613338306231383763
-63386364663238303431353362626366643735663935353930343535346337653432346463393463
-34333962646234663062303638653961656539306533313765616236393437613938353162663862
-32626631326237643136396137383839396137306336326633303139323330616165363561643735
-33396561653032353631353365646432326432616263313061353035633261343231323435646361
-32663565306238303539636664663230323861633630656634373664313964306264633439343837
-66633832613661366566666461656262323963393066333762353936623063343331663535366364
-38383435643339383661653662663164356662656339666262383833373739393031326132346566
-38353739383236333031313431343266386531656566643363633565646165326263376635633237
-36626430393935343137393166653237313733333236386634383565643061306536633866313335
-31303033666363393339373133383335633165643936333230373964623830616666656532663537
-31336363333162383232326665313738333262393930633039616439653036363633343932333564
-32316632643863323661323763616263643633316430386262343036353533626630623434383238
-32346362373963313934343139336164356638663936393864333733663931616438656230636564
-32333730333234326463373930336431663236616334386131663539376535376561333938333064
-61623834666163363632303065386663636332656139303937646431313933636165643432363032
-63653137626161383338373538363763333066326166376534313032303036396663663166633664
-62396536643335396164623030643139393761666230333730363533393263363664336163386164
-33323539326663373537316536663833313136653931383464396435626161303766343938363962
-38353966396264626239613564396331643533363865633030373161373832373463626635323932
-61356664646266346137366638316165366330386437653638353139306636393065373033616464
-30316235623732663635633538373430306437333232346162333037346636333234353934653137
-30383163353939366137393933333664633633646134656631616436623332303732626561303034
-31373633653732383039373635393366316531333662633264363239373863363739336466656632
-32623034633739353734316437663636356435383739306433636436373234383365343830373832
-38363265356536373432666232303735316232396133626437336564396261356137383633636238
-39303866373337386333386539623332356461653035303833306230613932393761383433646163
-61393439623236333835323838386666333330376164313964393964623739393263383032313735
-33646235613062323438353130383339626464383364306462323732666232333538383164323265
-35363339356534303963666633303036623164373036356132353663316331313732653530396365
-39616661383535396266626136643664376265623738636236346532396432633130366431343366
-38663765396332626638313762396234313730636166656166316338386130356538333764326566
-65626437333462643639316666326134303033373236373263393462393138313266646532373636
-61353263393139646361623730316139326536353961306262373931636162653364383232326536
-39666531613738623337363165383766393466316238633232626335363966396430613966323032
-38656162653764333931363737666538663664613439636436323662653763393432336134643633
-66323636646333373863313038633131323635396535316533663839306365656162663063373065
-38313231383965366434616231363535613737656436366138336664643133616434646165376630
-31373739393962663338376266666565613234386534373134346637646362353733373165626164
-61353730383463363131333066613862376131633965326466666130623663383731356463323739
-30373531336339633461363833643133333433383565343333343337303838373836616662653030
-31626538613165393062646132343362643462346633656136656162323263373236633336623463
-32323562376635363737656564356330346534653463646633386431373631383031646536613935
-36643838326136313732626235383861613561373431636230633630613133653831633262666335
-36386565376332303131616166373766633335303732333663363038323236636335326430636236
-39646664393830623630376332353431373662323339306430643534633135393237363531303839
-64396432313932363066313531633235383733333163346461373463313361653730616237356463
-30383938653234373562643862666533396437633837363031393439343333626435376431333162
-64363633393964313436383666366265326664333665376363666238343735356536383130356533
-65393465306537623465613133383663343062623033663730633639306462663236663336663832
-65646663303532383435336133666562323064306563343866363964633738343064666266343835
-36363537353738333862336638343938333739656562333965623863643938396661356565613061
-39313365663565326461306135663132316363323665613430393130353032653239303537356438
-61383662636430386663356466643031353438336465313062333863346635373838316431656432
-64323436316461626533316265643132643539333766643136346537326536666462393330333738
-63343866306437313064343131353364323338656537306237376435663662376237616436353039
-31326139353632323934366433366466313663666238306537343565643434643539353438313031
-31393336663632666630663236373731323161643631373534633664636666343763383935643537
-34393037336632386133303730356361306631643836363364363461336631343737366432666263
-31366531353634323866313032366132613561376431613439616634313861313231646435623863
-62306432656333383762633561303431353465346335653235393535343931653665366163666439
-35376239366431643661323237666137366238316463353263353134663537353430393631616231
-31343739613333366334373731386465663338336139313335666633363762643162613431313432
-64393839323361633561626437323964343232373431343764356164343436326230323961353462
-36376130316238313165323738336566383465366664353865343932363338633334646537616137
-61313335346233346336323166653163656236313534366230363363306431613131326439373364
-30353765306666306663646661666536653864363233303465336431633731353238393231336230
-39626461613739343932393139313366656235643366396163343335346337666632343962316236
-35386562636630393734666163636565326566636535323065653634643261633162363636383861
-61393463356363653839346437373662633163373538373364656364343762663239653037386332
-36323036313062356530303734353761336665626630616534386465663631313130623265343662
-32306562393931386535396364353031313162666664653561366361633730646261303734343639
-65376638623331643936326363306232366561346262366130376133633435383731393232393966
-64366563386634353961636333346561353862353663363639366431626136393665326166646139
-34323763383033383663646432343561363539383933366330383037393964363136656264623131
-63366337363564646362333633333739313764666437313634376533333139313739643831343232
-64366661623732646262383938633231363631326463623330313665303666653338373137613462
-35343366623066303661363330343531346133373862356338643135633332363965393464623437
-35306435333161623834383232346563303634343737363064616662333361336238633264353232
-35663336626434353263323630626463353138346665366633363035333132333038316239393335
-65653563313334643034303163393865393833393931383131376332386636653432303530393031
-65333132326238313662343066643561333864653731623265333031336137383634336664313032
-61306532653633613762393064663337326561663662343664643966623737613631646334303434
-34376532616536653664663466656638623234363337623266623637656463306363386533306561
-37356137623131623366363634633231623863613334626535663366633738663636643030353935
-61666235376564373530623038616165306333316333373036323433333936303830303333373361
-62366631313131333965373136313131636230353763643838343662643930343736646566343762
-61623431373164393663316235383136643037373036303830346234666237636339343063643236
-63633831316431373834393034323662633766333535623730636330323961616534363264373034
-38353232653537303133383935376632326265313164343832313235366261323432643262363566
-37363363376534333862636437636664663738666537613437326432373564323561643065666363
-64393466366264363634643462323131613861393765626531323166343637306264366337353764
-32353763636533626131333637353935316637643037663563306330633565666363373734626663
-30393863636634306334343530366138666238643765306536643036303434386532663433373739
-61343036386631383632303863346134366465353038356333376264613333643937623237343261
-38393130393634623764393032313664393433636361306537373834396330666238303562386230
-62366136363761306363666132356330306332366263303237346661313465353933656336626164
-32636133393038656339326131353762653335316664313833666439303236313561396461326265
-36366536303934363139393766663965363331373266343963386264316133636564613863303330
-33613336393734373362363963623836643362353938323635646634366362303538623465613134
-62396162326263633235333135373764343865383430333238376431646630373336326331303762
-30323539653836346464393738633265636564373138316665373562653534383233363066363831
-37396430636631623635323236343565313239613062393039623962343233663439386662363065
-34663733306566613739633266663265646232343165366536643763333736336333366666356161
-63383630303035356662623431656530643732393764626437363462323132373732333931656437
-64646266663837313536653331306134646437313165633361306439626261343661333837663930
-62386361616164333163366638613836366133323432666137633562626137316238363166306135
-36633233626561376264313238356262653438303737366432323432623063646364316635653132
-33643237626666323938613765653035333030313235633762363735636363303530323436313266
-31373561666638353536646336663734343864306236613430316563663939303533376665343830
-65636266363334303933633866353632383634353138636438333465656235306461626231646632
-65396162343164383632386637336435343166343931616464363462663234363234616130623362
-63376265336662343663663166623235333163626662343138303332303031666230306334626262
-33636463633835316338363462646563323633353337393566376261656135663139376263626331
-38393635333736643964316466656136333737313865323631663839653139303937393632633764
-61626364343733353433343737656532643533303962643136316533666631663561303066333737
-64343330356537616637363564393565383062643439396636383462376636363963653062636330
-34356233306238366566626661613131323334646164633734393633383963623938623564653333
-39623964663830353931313833613630336232663839653232313762346139393836306639356539
-62343137653039616437643266376638643135316137303665316430313033613833313830383333
-61383736316539353766623863306436366166663666346333653862656138616333616265666130
-61353065336333626664643562633538633566353930343261663537663861636666623533366363
-33386235616337623066643961386135333734353866313637316430333239373666383130663537
-31346539656633336334373364356365363130323937663137396363313131613536303262316237
-32626164366635663034656336333433373738343536303566663232653335346232353334383666
-62336363323765383935653163343335353966313664336539623434316161313438636335353639
-61653861393836353234623934373265663130396536353730623130346437656161323166623563
-35396266316163316533666237643230316364636666396661623730353433613461633664386166
-31323864386166626430363030343637383861373663353032383430623661323835376331643231
-32616466316564303962323434356464666264633466333230323061393231323033643866616162
-62303364303463373634376131306135663034346338376132623031393336383663623435366633
-66366664633364376466363434623836323135666535653132373134333838616639333362616532
-33323731653035373265393031636136653566393733383136626633386261303137313639316430
-38373963376562666533393533396535386165353738393239316139393239666138353837636363
-61343239373432663532623236393663623366313038333838343731383038383636393132303538
-62306332613434333531376330646434323664333134663235363762633333613864373765656630
-37343233336364343034623935373735396437626230363866363434343439613731616535386131
-30653136336133343835626439306462666162663034313864363536373461346234613631303866
-37313331646437366566313365323837323063393538316164373633626431643261383337336134
-66623165666565353364303737326434386235353535636662303637366239353630323331623263
-62306561353861393134306336653864343134636163623430633234336465656538396462633864
-62366139656237303364666565383061633266393830393133316632326165336235613031643738
-35636361633764313537356130343333383334333961616336613063663763636132626338376439
-62386232633636313439363263343835633662303361313161633331613261393439666434333361
-31383136373466633930646436346533323737353563633563653334396533333935366334346465
-31383964666430623135616130663630363061656166373664393161323765383165383732376134
-62626265643362633834326135613831626462396264636238383266613838376164303666363331
-37633962376366303462373864373538633766366337623662383836313739636637356165653263
-39663961633032633463336537393134306633353238383232376435633433373662636330346664
-31646634333933333231646564366635613164333063626233353336363639316262623964346664
-36353531626261353064613634376361326632396236613533663738313837383632346366653734
-30376537303236396631383761383462343666363936663031333363666531343139613561393262
-63376131396137656563646634323536343766633264313861333566306236326330653933306439
-62356465303464373062383766646536356439393631353538303730656336366339373030616365
-36363466383665633038636664613861623537386237663336356365316337626434376630636331
-62613632323436623730306666623861386536313734626163616135366133323764363563363032
-66386235666663656531383737643431633534363033626261613339646436393039333966383434
-31343439653266363037633233646532393031633965643032356635643965373930366635316133
-37353965636336356464333535653162663337303239306338303664343334613336366466386365
-31313439653937656461316365373431396434343861366638323361656139363566346639303532
-66333138626136376366336663306464303636633933373363376663366565636562396237323265
-61663166336535376536313361643562376236623365613965613730343864343436363737386162
-35373165386365313964396336623964363931646663336664383435613766633366333239323132
-33353633363239346139666433653133633563646661666338333232316266356530666138373131
-30393066373232323436333862343733663662306666326463646165613737356363373730313862
-37636533623536383661653432616464313562643430643862633734343031363665306161313638
-61323233636530343836393733383532653838616631353663643366636233346333633665643961
-66363030316530363633623630633739653631393535333038666632353064613664336134396562
-64616435386365376366656334383165363863353134306432623561306266366439303938383262
-32616435663831363039373931353831313739653963316130623363323431393935373530363036
-66343131313564613337396163316562653564623936323634323364666631333764343365396632
-34393238306361366561346633343437333532326633313936326331633566653138333931396164
-35666234623339383231616436326636366237623538356635636634616463353532633835316164
-61616632366462356263396363633261336534356264393533316364333463316664613933376666
-37663133336437313563386639313865303663643237656365623032333632623133306565613339
-66363032386234353635663261613462303838636663633435653463383337336436383536663963
-37663463633961333130376462653635303662366232336266663533306262623266306230663266
-34666465353734303464636235346266376163373534376633633437366663383338633737616238
-66303230386532303939653936316164376132626338353339393430326130663030616465356463
-37653164373561643135643166316232663961333431613862386334653637626432653536336263
-33623536663630663964653266383033626230323137326362303139643264336362343362663434
-66373639356666393465613465366437343263333534663665623137336434323234383465376335
-38646335303664656131333239353431343132353430303731363863396139313032383133303963
-39373630326334393934356461373336363332376665613433376630376464643235616533623062
-61393531626438623030613431303765353337363863353838306633353164363434363563363932
-64323634373731396262383839333038616233643734383538333233396238633261373035333339
-30366361373133303538346237636331653536376562303134633462373330363565643033336366
-31313962643532393332646264663030393938336365346331323265353030653434653338343437
-65303765663964613937646431346561663261373866626137373630623631643633343134323337
-37323364633538393839393139376262666333636637666461646165363834616432333365373633
-36633764303835616338323532363662393530386539356230346665373165396131373033666530
-30376262343662623265313761383837353066333362356338623133613230333461343861333961
-30653133656530623533383537353262326261636337643364636433653964643834306561626236
-39343634663939623034313866373339333761373830663661306532316533383235363237383464
-62616337326338313932336562336164626538336361323363303863646634383730643339393135
-64313139316161346232383964633264613232396536343365376662643038643765376239633335
-66616339366530613866343238663561323438323162366332303037343636393165346466636365
-31636634373866383535373737306561306366653066623438396336646465383034333464653635
-32363563356537653436636564303130336165376265303430386132643739316162386136636339
-30393262383037666136326435643330623033393535666638313631363166623534353866663732
-66633361306136626264613061313563353264356232636334656338356435326665643132313938
-31373132613266323636303465643233633439636366343166363938366664363562356537383163
-39623031323630356338333537356530643162316633646231353233643465386237356437316264
-63663463376362626530306461363333616234313032326237356666643361393934323463386461
-38346266346165343536386533356134313666383835373931316262616163376539386633616533
-32626563653434306236626135393266663262643762303037643534316366656233646430356131
-31646332366539303938343164343237393639653133363566653464656464636235306637363731
-37336334653833376363343030666632393637346632646462393264656262383131663135623065
-31333633313165663564346236646638323637336134306462373837626264366263306632346430
-38643330373832386165386136643666313963313634626363663934343865393961623939616338
-36383062363530666339303931333436373739623565633838306161643266393830643132333131
-30363432353238353961393334373235633265316161333461643438663738353666313235623030
-65383361353266313032663133373437363439363466373763623331363439653461616637666430
-33383933383531346133373062303664356536396662323138373230653362333336
+63396166656139306662643631356666333936386234376664383934323633313362363364373466
+6531343735326332633239626661343961616663313438330a313664326339383466623339356434
+32613234613566613931613033353731353237613434623031633433633137643338653534333164
+3039353964623565620a363665393234616430396338316131306462346336643738326361363030
+34323333626565663138626137613762326437396236643666626439393832643139656132313438
+30663664616539366234656265626265346436393663333961393036653936323735316238623464
+66633366343965313566626231336661646666393731393139613231343963376630303764393035
+35306162636365636666323734303431323337666434343464613532356130336561636563303466
+61616336376135393837313364353166636366653039313638316434373163643638346661313337
+62336164363664363165316233323837393930663934366438383166323531333139393939356330
+62303031303132353264313137333430643463323238623338356466663162626234306661343636
+30643030613637353435346664653937343133663039333663646331373764666339666163616137
+64653937663666616539653264303237316462376633336365323232666133626139373062356437
+34633365343336363433666663636462613039386465396633613737626238616339383439616163
+61333930623934643436663031613462396130333965353032356337386630343861396366356264
+36643335656537383235633961383437633734323938373966373935343766363532623266623962
+63653038303564313161336432326630623565616161333038353831346538623464383261636135
+61303132313931303663376337656534393032373566366264316662376336666335306561666363
+32356164353063313831386238346462623962626233313835643165306132303664333566616132
+65333533383637356132393533626366636237656666653739346264323630353661373636333266
+34383564363133303433383065366463623337643462636639383338363665623535396231653733
+36386662393230383264653262396666313432623137656538323537303866393662393564656231
+39356664656432656131396238666633336161393062373965663239363330653936343733323465
+35333233613637393634356333656136386137633665383330643262303231613231636232643238
+64303337643737316662336231343439333662313932376131626363363364663961393663346238
+38336136666232653535306631313538313831363433353661323164633530653937393061353064
+38626464656438343636396436636339666631303239646462353766613463383932343833646466
+34373961373766663930333337656235326437353963333538343636626233336336326361326630
+36366231363264333061386562333835383963623761623732616132313461336662343639633039
+39373936633234646563366535633966306661646466343366373232323562333630636164343838
+65386131323338666533366530336537323664306238633534646130356638653063363337353437
+64636564616539346334643762376233656339613630303235306563336534373038343265343334
+35303734653164646261636362653839343836343736613238323934393739633933613465343833
+31646630623735623265303666623036323661643737656332626431373036343435626637656564
+37303234383331373766363131383461343764626264626232663462393932313363336633323761
+36333163386530643933303231653538613735653666353530633061363832623963336161383239
+66396333613132666538303264346566613638623934653434323332303234323166383132653132
+36613232626164386335353465313766323131346265643263386566623335336266383263326165
+63323235303730363461373165306564623465653833313561373464643535306531383763306339
+39323363633337643532373438383436303764636334653035666131323232623939366465386131
+33633933396532633261363564396632373163373461333236313437393436303431666266316432
+38643762653831656435613134303165656331653838336362613665366666393961353565386233
+36626533636538323532373164633439646365666464363137633234646334653462303137343433
+37363065653162386266393831373664633438373336623434383135663131643866386266303037
+65363561656130633362656534323161363937306165363064656163353864326565316638353263
+65613964356163646231366635373233613961663535323935376230633833623861336334386363
+66643833666264666166306138333735316534373466313932356161313835313732393539643961
+33656639353830346663356330666339333033363665656164353732346131633330396161343464
+36656562373034656565313037303235373038383334616438313839623338613736343566353232
+35626533626265373763396364326434646265646335666639393039346132626166646261366633
+34356634353732353339383238373638323065343935353830353762396261313932613564353036
+35393137646536636161366637313664623061383366666566383861613232663536666332326532
+61633262383062396362316465353032383962663537643066343164353363326639306531346632
+34363166366664316637633131313639623536383739303831363262323535346537333466396332
+65613932666661623564383661643932323263646530393138336138306163383165306131353835
+31356332396239396139363338663533393439383136373936366634396338346461306163396430
+65646539383662653364623931663466653437633638663230623762623634336435666630373136
+65333238386262663239303166326236393438343631303361333632623433636531613435666238
+31326164613761613937313036656263303537613431393966393535313039303534643537323135
+30643264643963376465646430623064616262333337316264353333353133303631663631643934
+64363238363632643963366337393538323135346335386533646262313262646166396461663832
+39376633623462633564663239353264353933333833366134376363666135666262323261333636
+35623333333064313238376231653839373937623565356666363431636161373030346262316565
+37366365366234643833333336653438386439656236343630393330656561303131303238616364
+61656532366234653038353334646333313731323638323038313466386338663066353464346639
+36613336653739613030663131626262646439616330626637333432373264636261653063383432
+32376236366135363630356534613834303833363732646262316235373563343535313139626565
+64303031366438656230623161363032643034306133396663653963303665333033383561653363
+36303033383861316530626464646465656263663133353235376264623066666335366165326333
+66336562306265363635356362343236383864386439376661643066623963383365663332613538
+33613034626134663536656438636162393963623539333338613930326335316236343838623963
+36383861633134343062303036363433653136383161623032323762396536306265633461653739
+33666533393261393333316162633030643934343233366333643334393161376433386261646161
+30356630653630303232633066646330346233646335353032656539343665336363386133373138
+32376331303466623636336232393964306130663163393334366333303765373364376365663430
+34643937353732373863313431633039303065386437336663653636663665306165336135663436
+33636336646338616434313033306438343832333737303433383935396439323662303361356566
+62636332396664616238386563366231346266366534633065646165366134316364633434616563
+32653238663964646165373966653563303934666535663762373631623062643765363565636130
+30303766373239323766663838376364306536383966356334343734303837353666653263383463
+33376265316664636561363832383839353761343461653939343365623333336561383538643163
+31653365353336323162303764663130636630313264396230306330316231333265636164623037
+62313363306464306631626461666433393532656437646637646135633431353361336363666335
+37333738333362643137393466656666363263663130383538636663643235336566646463343633
+65613639623137393338356337306431333465336137373830353563663231663735623538353262
+61613135376566306432653330326363326132303433323234613632333036343039653133303932
+30393936616630303662346439316436373665633837306465313265366136396637313435376136
+37616566373438653737323961646164633539373063316262646563643932646366633466333532
+36616239663430333663613435313161313565376266353837326337373236363964363432363338
+39623438616561636263333866613339366366313230353263623834383430623730636434383163
+31376632336439396236353066383266613838626562653330303536396530396137356638316163
+30313737333135393933356165366466386664653736353937373634383965363664626534666166
+39663937376530326164383635633566383366373766333231303238656539613139363938326665
+36613365656465386232613863346133303639636431343361326138363265393935366635346431
+30393063343136386464353761366330643061363930653037623437353636316564633838316161
+35663939646538643931646439323039643135393366336432616466633638363462383338316634
+34663131326562336333656161656262656561663062663964646661366231356537386363386662
+66396333633930303561393863656637626133653762666330306561323736313164633364613261
+35336565396266356563313436316234666632643765663833616137643031646533613334366661
+37363266386532366639336236376666663939363634306435323635616239303935613364613163
+63636164363939356139343661363065633439653364623363326133313035653962636536643264
+30306431633166333734613330626366393439313433636461626131663666323735386563333662
+65616339643463323735323235626531313632633735633237623435643164373332343262616234
+34356435656464326561353964316565346438653566613763636334356630346436316530316162
+33326362313232663738363330646131623932376361653561353263633235666530363137356463
+34623332323639333165373036663765336664643835313832653164393461306665613538373839
+61366466353164346164363565636637616131663330393937636361623136643965323061356334
+39613430376163373933356434656261383238323037666437633536363864343864356633366462
+30383235383538376566613131353132646137656439393036356461306635613466313336666431
+33393861653233303137616135353137663262303233623662646161313739613937626435366134
+39636461653638663336306561353166343035306633376531373162303538346430643432383838
+30333463343039663937613863363232306265363934663735643865303766336339666266343633
+61663430323638666434366139663835316637616163313237373437656235326138373936396538
+36383336386538373437663661643039396630663766666630643963653566313463666665613238
+34373537356161316461343163646630313232323537336635666564363565386535383361303039
+66393064633562626330623165356263306162366634623634386162636239396563393838353232
+32376266323962616362386433376662623236643535366363326234623835353133313762303432
+66353832383765313636663336323234613666663335313730633562303563313734653632633864
+36316538386261346232303666663230386463623432326536363933623833393136333235313038
+64636537336132633133653366616330616364663264343863653564353039303564623237656630
+34396330656339613836616364383638656361613061393332313533346463323932363738366562
+33663565373138623239323639313438393939343137316133333565613966363235363437313937
+61616365373139623431356536633566353962633866323266333533333632636136386432373936
+34393636636637333966646638323164356630653462323638623036626139323464623861313662
+64303231646162306536643666613763313866343665636234316131386438663166353763303735
+37373934666536656230393339383263653166643433613033633034356164396138306436366334
+62663062623564393037666237646431623933393861306331383565666464663631333464336662
+31356162313338356332386463323963363563616436366136653663663961353361396435393232
+31383865333962666131383635626665376331316639653264363561613965336232346635303163
+30306637343935316437396538653032306463616530623637333061323164656238316561636338
+32643537626436376265306137623566306234303065663735306330386139616161333834303664
+31313431366563623430643537323835333034663939626539373334333464643866623035323762
+34333365356132323539343433333932623862633930333964353137376237323437656634343661
+36656639656265373835623861626135666433626466396666306535323834313632653066623062
+34623766333630313037393764326633653631326538643862373265366263346536613661383739
+38653261383366376532323562393931383263356137616637663531333337383438353963313262
+39376130353936353533316238313466666361303063656232646335666638393634633265666666
+36643761356137343434333037336135326634653931363532306133663834663866336362623236
+34646532393731623030663331373231306636383039396363386536663138366233313236353161
+32326338303635313535653837616331326434376533313862356135633830373133376235633331
+33646565323566333064393938393862343732623964373935353032336339623663663235373135
+31613164646539353132643231336535396265373430633438643836323930313232633735373063
+36613037303932316366333565343364306561316434386163353064366562336262653439376538
+38613531346237333262363166633534663731363563623438323837376162323236356463326433
+33336533613063353639643636616433386266316562336337323032633936386631653330366666
+62666562636231643736633631613931653535326435313037653539363439386135613638626464
+37393639376234333831633664356133303035333166313433323138643232366534643334653439
+36303731336461396665613236393164653363636665373961323866656364373839623361356264
+39613738353537653465313265313037336135396631376438663433626365326237346233313463
+64336236313232336634343634666133393666643562623361313331666338343735383437383434
+34666265363532353833633463623533323735626366636532333837613062626265653961653766
+61333239316666666537646464353531333837386639666139306336616561656338313461353563
+33666336646237333539376638633537393964373239303263333839313761616339623131633737
+64336438376537356264306166313137373930303165396264366331636230346339656332636161
+39373965346366346531633437643832643334303663613263626636653538653830613832613031
+62643665393435373333653431626361393866346337343238323030363236376562323435313637
+62316133623538623234376336616666393037343135623961313131663561316239313262313461
+35313536626535623564656230323264623534643732323166343261636431343839356431393764
+36663233653531616538353730373763396431346264393531343238383431656135393932363137
+61373934373635346166636661616536663239613936396166343533336630623636666162346537
+36343862656362396362663638336262653839303736633436333066396563376330656361633165
+61396431396339636163346538303435646432356165626435366565633062396263363635333463
+36396462356438336666343962323334626135346132366135313436613439653431626233306537
+32386462666262613535323565366636613536396639336636326234343337646538636531313130
+36366464336263643633653538313336333162373332663330346239366534393161363230323666
+63643165356334626366626437343232386536313731323964626533326366366539323064653961
+31313662346432366633393938643466303134626635623663336333393663383563316231396534
+34346462383133373239353931333331626465663065643636386566323137333061333661386562
+39373264313833613863383439623862653430326136333862386461663066343562653763323634
+34396635316362313563613331333765653630356361383938313030386466333936353261663539
+39373336306635323739326238343061313561623338663764643263323235323739393037303663
+63373161316535613635393034636336616434313634633234333231623338343962656230643536
+36646230346538373763303965326130623838353936306663643132313537326632623031653564
+63616661356537323730346236623362616561373063323133353639626534326631336263633362
+66373835323962336539333839313766393636386336366634353431363034663236666266386134
+65323939383630353830393465616437383165646534663233653365656132316137366430353138
+34663236653662353364353161303437623164326165353763383038326434333765396537663134
+65653933333338626266323361366233646466303936643063323436366261313762633034616535
+34343538656466323266643435313336663337643064623232363463303863346664303065356263
+61623863626531333362613436303332356335646639616531383636623037393536343530333066
+37643932663139636365633766346638653462303466323763663461626161393436396330343537
+64383231386331653438356261656364363966663537346433373463613466373162643531346235
+62613132383762326639663333633138383763353737666435623061663432633930313632643731
+35396132356266663934376231616634306661396566376132643764666431383736353366396632
+35366264623937643338663432363632653162643237373637666164613462623838623037656165
+30363934303731373239393164336432366236343937613465353863623535663063373864363733
+34313165306266373765643535643336383637353362653866376633633161363564316330353461
+63653332326161636636326231363132356364663931643230666333366433613333373465613135
+63326531623166376131316139373939643434363939323862343639613536373465616564333631
+37373132646661316363323166373231666239623534323135643565656138333364646336373063
+35623462656338643539313462393633633236333936613764303565613238316564376231356132
+31326364336161626432623837653537363632313766663265633737666331326435303437363933
+63306462633333633261663436313065343335373462353762393264393737353039623731396463
+64373164613931633461643139363531323262313364383732323561336632386462626236366562
+61386135343031333830336663313564336362616163366562316339336161393235633332303665
+65396261363462346163613236636232356435653062326538316261323238343139373665636266
+35323032346461313262653163333333353633303733333236363337353765373336656133393838
+38613831333864323432393938313664343838663537356461616161336562383863626464373538
+31356266373730386232306365326262323064636138303938653965396462313031633864353066
+30613431656665666630646137303363643963393466306236303738313663393432643664636137
+61616361383561663030363636393938306536316230333631336439373466663733336237343162
+31653536376366376139343766353331386162363630393331343662663037343566363332346363
+34346439396236613936613661343332623434393138666266316433663135313637386262643539
+65656231643637396337653233356439303430663337333334633832653765623837376138316338
+38623536656662393566653563626365393139313566623664393432343330616464656162393339
+32316538386161383632393135623363346339376562376531373763626465316164636364353566
+66613164656437366663386536616561306231343763663932336233363962386237306334306234
+63643565656334316636313264653330386362623563666562393335326637363434663437653262
+39383038626263623732383266363864623863323765656161383530326261353863356332303739
+36333866373035623065306532386562323233343737613337313239646130623964663332383561
+66343963643064323738383730653739643838316539653038353231613131343664353863386162
+64346430646266393134623065643332333265356631633461383234623736653265646562353464
+34396637393662373731363338333664653933313437306561373133336634336466393234663633
+31303061613131353930393330663334656633356361633866333264663930636363393133623466
+34636237396239376464343238623833363838656234363836323338323838343465393462306465
+31376634663832366536663166643338623638666536363938623634646561343237313266636533
+62643437316435633634613062303463656364313936366231336531306239363633353236333831
+37373436373435636333303065613835333630376536353739653237356633663236613364366239
+31633935363062393862356432393263616263313037646666623432316630316666623464323866
+38336536636665373532623533383034386266666335663837303766656338646530373030396366
+63633166313530663166333065356338643066353164343964356331633236343966333837646561
+64363933376333383461363165666438303062346165323934326639393239643563313861316565
+66356465343437663963386438613561663063376431366166386133366137623761353130383364
+30653834643335313864663436323233333065643531623636656138663462633061376164663062
+39643061343361303537376339633839323130316266356639303539366464666130366532383135
+37346264303265356664373532306661636163383730313236666366616363306532303938613733
+32326232656531366334646463386131306461633834363861396164653231303731366566316234
+34333738326565386434373961326364356666633837383230376565383139616331663936613930
+30373630373239623230316461306332633765646338626437646561323234376232626561343136
+64643331663236616535636462653962336262333433656537333666373932623562633239623038
+35333736396236323537336431303532643233626630626133316635306665646536376430613435
+62323361346438646238666235623336663062626637353261363161616537346237373933353063
+38383530353661333566383166613062653062333834376635336338326463373332663839386639
+38396435346630316137616639343362343962383164333638326566346564376666356431626631
+37373838653232366238623063623936343432366563373165343662393166313834643162646264
+39353430633031386437383838323264303861306364623338376332336336323063356630653733
+66316661623265306166333137323738633963616531383834356231383833383064313839633036
+38643163633438303038623363393266343235396263373430396430666465316631653731386435
+37343362376232326634333336336438306464383665636132393937643163353738316265396561
+33663734633335313438643661336237303439316633353539366231306262393832313165666439
+37323162653931366163653564346262386238626166653462333132663264643738323033323131
+63303765336465393435633365346566343362613864343161383432323233656133316536383433
+65363131303631313231613362373166386161623066303561636362643237353439336637326335
+35343039376631373663376561343231346464333065393334383265646638393637383937666531
+64396539646563386461633134316239653863396634643833623638626636626636343838356637
+31396338653535643533383339663861343065383430663030633064353465656139366631626134
+37346434333630333133363866613665353164626163383039393661636265373933363361343262
+66383261366562336663376164363733666331326664616230383665353534363362303332666337
+35636262363532363836313937656639326233303032656366383165343438343465336539303162
+34323835656465356436613164323137353366646266326464616662393535326436623538383938
+39383934353164636434633532343538343431653939373730373630366438636465386666626239
+31653239653164326131343134376161626337666638623733363734393866613338383737383761
+39663664303963343066363665333732366539316535363036363565616565636139306663346263
+61313131333138303730353237393231636539643563356238653164396330353132363735313536
+33363162306665653433336339323965336161386339313564646638353334613832653066323536
+38326661376230306135386136393661383765393363373438646239663938306666366464636637
+34333732316461616534393063653964343262643933303864666136313433626261663833666233
+39663431303139373165646236376631326336623964663830663461343238303962663635376330
+66316266323765303731353136663035373434313938303333613063343236653630396663616464
+30613430313435396639313930373832363262383530623061303966346336363635623139336434
+36346664663965366538656335356437623863343030393765313166643837393263363061376135
+33653262373230373237396663376533656438333135646365326264656635373439633162633534
+39353131663530393264306363643532303761633331343562363665323236663334396366663561
+35613666613631633038353635323833333338346239666163633237613633626461343162646339
+66333332383732613231616630383433346637363036643936346431326139363132393064616234
+64653466643338383766396338626439333531306534313635663032663835353765393034613235
+39643564383036333531393731346432303339666266366234346562663862383932626430376436
+33363666626664376162313733376237353137346361646263353335656563313563383634316365
+31313461373630353563303931353135623364636536363237656337663064633032366236393039
+62653663643136623638666633373362653862383566373935613165616462643031626539353965
+33353638313831306134306564356663663363613731353534316239353930383561363462316631
+39396164396235613033613832633566333461623862646266653737663832363063313962323232
+32383733643635376363636137323362393035353466666666373633623462633635336665366336
+36336365656137666163643832396237313565313033623865343333383837396638616438353531
+63623738386634373965613662623566303430343733656132656236303461373461373837396236
+38373762316362633261306239396236393539336632643636376233303538396162373261333730
+30643365633165313037643535613961303836366434393837393063363864363764306231643866
+63383039343864643632306261353564326433666561343237613430623735623461646332366565
+39653663306438336466373566343130343062383862633262633863313638373966366133333664
+37333831636163333533636362396439653536613532663931653030306664313833303637616132
+35623662623137653830633438613034633433653961663936623365303432396231366635353065
+34386434373830366538346666336361333139623236326332633833623439346333393034663531
+63313338376432666666363565373930373733343734363766363462373139666234386333616537
+31323965663737336539616365613064373165363932366538646536313239633565346433666630
+33303134653362306462636165613639333163303738643463393864346164343032393832323230
+36396531613336353734653736323764393838323661356133313961306161356431663832383735
+66313735386661333030643538313230373035376334393636613036373864323161386430346430
+34626366613034333963303130383039313438643564333134646536636332613938323535646135
+33376165653937626561363231353133313533663237636632316338656535373730653730356332
+66363931356539386463373463373736386665313862356636666337383262393065636536376335
+39366330343934333262396337663938656362313030363963393063613464323333343330646665
+61613432323332353333383263633662646564633932373862623638613538326136616231376536
+31343331316238653339313166396161323865326139616433633465356666393631393533306165
+32613661666332353366376563326163663833303262383461373830333133346337613237323530
+66333363376164373661646464633161366564616339393131313466646534643432623033323238
+33353632353064333239343639396435336131363238653139373262663439663433343235646266
+35643539313761346239643631326130373266303439383239336531343339646334356265303935
+30366363633536663163333165396535373763343566356431303662313232393063383862326535
+31353635366638336339613064353133663132383837613031316466303139333539343831653632
+33303036653464356434353437313765363938393664343761653038363231636231343333353539
+38653961653663383035333264333464326164303035376332663366616431313632653731386439
+66376562366231613839383937396431313761383764666637626434626262323831343336326433
+66343234353566323861313034633664656130663932336264653963613636623263636161363638
+39323062346237393838626136636136333462623132376361323061376332303566306338303631
+39313365646365393034393830376165383966326666353838343036666633306134643032346363
+63343432386165383764326230343964646233623931653366366530363032363734343635333334
+37333162613362336262393139666139393230393465353635323239656338386563333735303330
+39323135343930356562386566613766366264323137636633323535313563393664383766633538
+33633236613064633236646463396237333030326333316337383934623037613833363733363064
+32356662353530356563366635623231666532376264366666663934636664363563663962363436
+30343534636532663161393561376561303035653030633163646530653462393336396539313937
+38666633383830633863306664323831333235633335643039346338633130313061653263303636
+33323534636430633432636530316135376639353437336437636332613031343637636561333863
+34396138623437356336366531333464333733313939356638313463646131623366643039313336
+38336536663436323764363766303561666461363937393738646564613532323639613764353032
+34383537376664643261393232323530616561376662386633613235316137346433633530646131
+39663438313130316638663730386635323964323561363337643566626437383338663938383438
+38366635393939626633396331333563303466363863326138306337303566633166326565376636
+61356665616662386630626663636665613730626230356538366635393965636236336132396236
+39643862633937343165376536633364646264623733373464633537396230306639386163386137
+30386461353661376537326665363031313065653731383638376365363061303366373132623238
+37346536663536373763336666663932303062616533383631373030636437386532396236646137
+62313037616234363535343863633733313461333835316137336638396666363764346135633938
+32303836613334383737343461613938626636666138386464373238663639363638396535393333
+38623033376161626438303866623531666433333133366132333237306365336338326434323864
+33623033626134363537613435323734656231326366646362646538643839373833306661316434
+36323437333663313233393465333964396161636432323134313732303835323735336164303435
+39636565306163323730653564316233306632663834616631636430363433396434386263633863
+63346330313938313262353435653830356265353065393666306663306337393936363435383538
+32316131653630366431643863396435666163313634663161326332353038613066396434386538
+61363539383963653732306133363132343737306262656236333638393235306530623938656438
+33356530373963343563663439656336383964633833643565663639396236323565643032386261
+62396665643464306665343037323563623636643134656632613963306533343831356437626261
+66306336386365303963626334396662333130336435333334343137663635343138616235316238
+33353337653338343933343539633565636635636133326265646563323034333532656136303939
+35333636386139306638366666376466393763373936313433363461373062333738373765623866
+61646666323639613035343363613839383765323063353033646639646437386537326436366261
+64363966316639646131313437303234373965613565336164383866616265393563666638343664
+66396130643433316333636164383566653138326239623535353136636138623839666537383166
+62373531613132623761636662346538653334393031623865356534626235373564666561656533
+61383262626133356231306365396331303335613130333335313131613130633637366437356238
+63613931393833633961626333626433353864316133323265653934613533646565353764643239
+36653463353635313536353462323862373939383330356663373239373237313133333531663463
+39623464663063363962626231356236383065303239366131313565383663343835623034383063
+6637
diff --git a/ansible/inventories/test/hosts.yml b/ansible/inventories/test/hosts.yml
index 786479c48..0e90bd075 100644
--- a/ansible/inventories/test/hosts.yml
+++ b/ansible/inventories/test/hosts.yml
@@ -22,14 +22,23 @@
 all:
   hosts:
     custos:
-      ansible_host: custos-deployment-test.tg-ccr140004.projects.jetstream-cloud.org
-      ansible_user: ubuntu
+      ansible_host: bm-dev-1.usecustos.org
+      ansible_user: exouser
+      ansible_ssh_pass: "{{ ansible_ssh_password }}"
     keycloak:
-      ansible_host: custos-deployment-test.tg-ccr140004.projects.jetstream-cloud.org
-      ansible_user: ubuntu
+      ansible_host: bm-dev-2.usecustos.org
+      ansible_user: exouser
+      ansible_ssh_pass: "{{ ansible_ssh_password }}"
     hashicorp:
-      ansible_host: custos-deployment-test.tg-ccr140004.projects.jetstream-cloud.org
+      ansible_host: bm-dev-3.usecustos.org
+      ansible_user: exouser
+      ansible_ssh_pass: "{{ ansible_ssh_password }}"
+    old_custos:
+      ansible_host: dev.custos.usecustos.org
+      ansible_user: ubuntu
+    old_keycloak:
+      ansible_host: dev.keycloak.usecustos.org
       ansible_user: ubuntu
-    old_server:
-      ansible_host: custos-deployment-test.TG-CCR140004.projects.jetstream-cloud.org
+    old_hashicorp:
+      ansible_host: dev.vault.usecustos.org
       ansible_user: ubuntu