Add get drive customers script to all servers

This commit is contained in:
Micke Nordin 2023-08-16 12:53:08 +02:00
parent 58fd21e0aa
commit f56a5c6eae
2 changed files with 19 additions and 0 deletions

View file

@ -48,6 +48,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 { '/usr/local/bin/safer_reboot': file { '/usr/local/bin/safer_reboot':
ensure => file, ensure => file,
content => template('sunetdrive/scriptreceiver/safer_reboot.erb'), content => template('sunetdrive/scriptreceiver/safer_reboot.erb'),

View file

@ -0,0 +1,12 @@
#!/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
yq -r "${filter}" < /etc/hiera/data/common.yaml