diff --git a/bootstrap.sh b/bootstrap.sh index 365f3026d..382e09198 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,6 +13,7 @@ ENC_CMD="eyaml encrypt -o block --pkcs7-public-key=${PKCS7_KEY}" $ENC_CMD -l 'profile::freeipa::server::ds_password' -s $(openssl rand -base64 9) $ENC_CMD -l 'profile::freeipa::server::admin_password' -s $(openssl rand -base64 9) $ENC_CMD -l 'metrix::password' -s $(openssl rand -base64 9) + $ENC_CMD -l 'metrix::slurm_password' -s $(openssl rand -base64 9) $ENC_CMD -l 'metrix::root_api_token' -s $(openssl rand -hex 20) ) > /etc/puppetlabs/code/environments/production/data/bootstrap.yaml diff --git a/data/common.yaml b/data/common.yaml index f3e63ecc3..bc754b4ed 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -344,11 +344,12 @@ profile::prometheus::slurm_job_exporter::version: 0.4.9 metrix::prometheus_ip: "%{alias('terraform.tag_ip.mgmt.0')}" metrix::ldap_password: "%{alias('profile::freeipa::server::admin_password')}" -metrix::slurm_password: "%{alias('profile::slurm::accounting::password')}" +metrix::slurm_user: 'metrix' metrix::cluster_name: "%{alias('profile::slurm::base::cluster_name')}" metrix::prometheus_port: 9090 metrix::db_ip: 127.0.0.1 metrix::db_port: 3306 +metrix::slurm_db_port: 3306 metrix::install::version: 1.6.0 metrix::subdomain: 'metrix' diff --git a/site/profile/manifests/metrix.pp b/site/profile/manifests/metrix.pp index 61f26275f..bcf2b8e75 100644 --- a/site/profile/manifests/metrix.pp +++ b/site/profile/manifests/metrix.pp @@ -15,6 +15,12 @@ $int_domain_name = lookup('profile::freeipa::base::ipa_domain') $base_dn = join(split($int_domain_name, '[.]').map |$dc| { "dc=${dc}" }, ',') + if lookup('terraform.tag_ip.metrix.0') != lookup('terraform.tag_ip.mgmt.0') { + $slurm_db_ip = lookup('terraform.tag_ip.mgmt.0') + } + else { + $slurm_db_ip = '127.0.0.1' + } class { 'metrix': root_api_token => lookup('metrix::root_api_token'), password => lookup('metrix::password'), @@ -23,12 +29,16 @@ db_ip => lookup('metrix::db_ip'), db_port => lookup('metrix::db_port'), ldap_password => lookup('metrix::ldap_password'), + slurm_user => lookup('metrix::slurm_user'), slurm_password => lookup('metrix::slurm_password'), + slurm_db_ip => $slurm_db_ip, + slurm_db_port => lookup('metrix::slurm_db_port'), cluster_name => lookup('metrix::cluster_name'), subdomain => lookup('metrix::subdomain'), logins => $logins, base_dn => $base_dn, domain_name => $domain_name, + auth_type => lookup('metrix::auth_type') } Class['metrix'] ~> Service['httpd'] } diff --git a/site/profile/manifests/slurm.pp b/site/profile/manifests/slurm.pp index dc16dfc50..542dd753e 100644 --- a/site/profile/manifests/slurm.pp +++ b/site/profile/manifests/slurm.pp @@ -297,7 +297,16 @@ Hash[String, Array[String]] $users = {}, Integer $dbd_port = 6819 ) { - include mysql::server + + if lookup('terraform.tag_ip.metrix.0') != lookup('terraform.self.local_ip') { + class { 'mysql::server': + override_options => { 'mysqld' => { 'bind-address' => lookup('terraform.self.local_ip') } } + } + } + else { + include mysql::server + } + include profile::slurm::base mysql::db { 'slurm_acct_db': @@ -308,6 +317,15 @@ grant => ['ALL'], } + mysql::db { 'slurm_acct_db_metrix': + ensure => present, + dbname => 'slurm_acct_db', + user => lookup('metrix::slurm_user'), + password => lookup('metrix::slurm_password'), + host => lookup('terraform.tag_ip.metrix.0'), + grant => ['SELECT'], + } + file { '/etc/slurm/slurmdbd.conf': ensure => present, content => epp('profile/slurm/slurmdbd.conf',