Add get drive customers script to all servers
This commit is contained in:
parent
58fd21e0aa
commit
f56a5c6eae
|
@ -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'),
|
||||||
|
|
12
templates/scriptreceiver/get_drive_customers.erb.sh
Executable file
12
templates/scriptreceiver/get_drive_customers.erb.sh
Executable 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
|
||||||
|
|
Loading…
Reference in a new issue