Skip to content

Commit 906b427

Browse files
committed
allow to split metrix VM from slurm/database VM
1 parent fd65750 commit 906b427

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

bootstrap.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ENC_CMD="eyaml encrypt -o block --pkcs7-public-key=${PKCS7_KEY}"
1313
$ENC_CMD -l 'profile::freeipa::server::ds_password' -s $(openssl rand -base64 9)
1414
$ENC_CMD -l 'profile::freeipa::server::admin_password' -s $(openssl rand -base64 9)
1515
$ENC_CMD -l 'metrix::password' -s $(openssl rand -base64 9)
16+
$ENC_CMD -l 'metrix::slurm_password' -s $(openssl rand -base64 9)
1617
$ENC_CMD -l 'metrix::root_api_token' -s $(openssl rand -hex 20)
1718
) > /etc/puppetlabs/code/environments/production/data/bootstrap.yaml
1819

data/common.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,12 @@ profile::prometheus::slurm_job_exporter::version: 0.4.9
344344

345345
metrix::prometheus_ip: "%{alias('terraform.tag_ip.mgmt.0')}"
346346
metrix::ldap_password: "%{alias('profile::freeipa::server::admin_password')}"
347-
metrix::slurm_password: "%{alias('profile::slurm::accounting::password')}"
347+
metrix::slurm_user: 'metrix'
348348
metrix::cluster_name: "%{alias('profile::slurm::base::cluster_name')}"
349349
metrix::prometheus_port: 9090
350350
metrix::db_ip: 127.0.0.1
351351
metrix::db_port: 3306
352+
metrix::slurm_db_port: 3306
352353
metrix::install::version: 1.6.0
353354
metrix::subdomain: 'metrix'
354355

site/profile/manifests/metrix.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
$int_domain_name = lookup('profile::freeipa::base::ipa_domain')
1616
$base_dn = join(split($int_domain_name, '[.]').map |$dc| { "dc=${dc}" }, ',')
1717

18+
if lookup('terraform.tag_ip.metrix.0') != lookup('terraform.tag_ip.mgmt.0') {
19+
$slurm_db_ip = lookup('terraform.tag_ip.mgmt.0')
20+
}
21+
else {
22+
$slurm_db_ip = '127.0.0.1'
23+
}
1824
class { 'metrix':
1925
root_api_token => lookup('metrix::root_api_token'),
2026
password => lookup('metrix::password'),
@@ -23,12 +29,16 @@
2329
db_ip => lookup('metrix::db_ip'),
2430
db_port => lookup('metrix::db_port'),
2531
ldap_password => lookup('metrix::ldap_password'),
32+
slurm_user => lookup('metrix::slurm_user'),
2633
slurm_password => lookup('metrix::slurm_password'),
34+
slurm_db_ip => $slurm_db_ip,
35+
slurm_db_port => lookup('metrix::slurm_db_port'),
2736
cluster_name => lookup('metrix::cluster_name'),
2837
subdomain => lookup('metrix::subdomain'),
2938
logins => $logins,
3039
base_dn => $base_dn,
3140
domain_name => $domain_name,
41+
auth_type => lookup('metrix::auth_type')
3242
}
3343
Class['metrix'] ~> Service['httpd']
3444
}

site/profile/manifests/slurm.pp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,16 @@
297297
Hash[String, Array[String]] $users = {},
298298
Integer $dbd_port = 6819
299299
) {
300-
include mysql::server
300+
301+
if lookup('terraform.tag_ip.metrix.0') != lookup('terraform.self.local_ip') {
302+
class { 'mysql::server':
303+
override_options => { 'mysqld' => { 'bind-address' => lookup('terraform.self.local_ip') } }
304+
}
305+
}
306+
else {
307+
class { 'mysql::server': }
308+
}
309+
301310
include profile::slurm::base
302311

303312
mysql::db { 'slurm_acct_db':
@@ -308,6 +317,15 @@
308317
grant => ['ALL'],
309318
}
310319

320+
mysql::db { 'slurm_acct_db_metrix':
321+
ensure => present,
322+
dbname => 'slurm_acct_db',
323+
user => lookup('metrix::slurm_user'),
324+
password => lookup('metrix::slurm_password'),
325+
host => lookup('terraform.tag_ip.metrix.0'),
326+
grant => ['SELECT'],
327+
}
328+
311329
file { '/etc/slurm/slurmdbd.conf':
312330
ensure => present,
313331
content => epp('profile/slurm/slurmdbd.conf',

0 commit comments

Comments
 (0)