From cc43ea5b7f9853b2483aa732de2caaff5c079ecc Mon Sep 17 00:00:00 2001 From: Johan Wassberg Date: Tue, 27 Feb 2024 13:30:55 +0100 Subject: [PATCH] Configure SQL --- global/overlay/etc/puppet/modules/eid/manifests/idm_app.pp | 3 +++ .../overlay/etc/puppet/modules/eid/templates/idm/idm.yml.erb | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/global/overlay/etc/puppet/modules/eid/manifests/idm_app.pp b/global/overlay/etc/puppet/modules/eid/manifests/idm_app.pp index e24c7e7d..e51093ca 100644 --- a/global/overlay/etc/puppet/modules/eid/manifests/idm_app.pp +++ b/global/overlay/etc/puppet/modules/eid/manifests/idm_app.pp @@ -3,6 +3,9 @@ class eid::idm_app ( ) { $redises = lookup('redis_cluster_nodes', undef, undef, []) + $dbs = lookup('sql_cluster_nodes', undef, undef, undef) + $sql_password = lookup('sql_password', undef, undef, undef) + ensure_resource('sunet::misc::create_dir', '/opt/idm_app/config/', { owner => 'root', group => 'root', mode => '0750'}) file { '/opt/idm_app/config/idm.yml': content => template('eid/idm/idm.yml.erb'), diff --git a/global/overlay/etc/puppet/modules/eid/templates/idm/idm.yml.erb b/global/overlay/etc/puppet/modules/eid/templates/idm/idm.yml.erb index af268378..7f01846f 100644 --- a/global/overlay/etc/puppet/modules/eid/templates/idm/idm.yml.erb +++ b/global/overlay/etc/puppet/modules/eid/templates/idm/idm.yml.erb @@ -38,3 +38,8 @@ spring: trust: resource: file:/etc/ssl/certs/infra.p12 password: qwerty123 + + datasource: + url: jdbc:mariadb:loadbalance://<%= @dbs %>/idm + username: idm + password: <%= scope.call_function('safe_hiera', ['sql_password']) %>