Get drive customers

This commit is contained in:
Micke Nordin 2023-08-22 17:13:02 +02:00
parent 58fd21e0aa
commit 364a8685a7
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
2 changed files with 18 additions and 0 deletions

View file

@ -55,6 +55,13 @@ class sunetdrive::scriptreceiver()
owner => 'root', owner => 'root',
group => 'root', group => 'root',
} }
file { '/usr/local/bin/get_drive_customers':
ensure => file,
content => template('sunetdrive/scriptreceiver/get_drive_customers.erb.sh'),
mode => '0744',
owner => 'root',
group => 'root',
}
file { '/root/.bashrc': file { '/root/.bashrc':
ensure => file, ensure => file,
content => template('sunetdrive/scriptreceiver/baschrc.erb.sh'), content => template('sunetdrive/scriptreceiver/baschrc.erb.sh'),

View file

@ -0,0 +1,11 @@
#!/bin/bash
mode=${1}
if [[ "${mode}" == "multi" ]]; then
filter='.multinode_mapping| keys | join("\n")'
elif [[ "${mode}" == "single" ]]; then
filter='.singlenodes| join("\n")'
else
filter='.fullnodes | join("\n")'
fi
cat /etc/hiera/data/common.yaml | yq -r "${filter}"