Skip to content

Instantly share code, notes, and snippets.

@beddari
Last active August 29, 2015 14:23
Show Gist options
  • Save beddari/513882f6a5f94b7d724c to your computer and use it in GitHub Desktop.
Save beddari/513882f6a5f94b7d724c to your computer and use it in GitHub Desktop.
define bmcremote::host(
$data = {
'name_of_host' => {
'ip' => {},
'user' => {},
'pass' => {},
'settings' => {}
}
}
) {
# Simplify looking up data with an index variable
$index = delete($name, 'bmcremote_host_')
$ip = $settings[$index]['order']
$user = $settings[$index]['check']
$pass = $settings[$index]['set']
$settings = $settings[$index]['exec']
case $type {
'idrac8': {
# device specific values if needed
}
default: {
fail("bmc device type ${type} not set or not supported")
}
}
class bmcremote (
$package_names = $::bmcremote::params::package_names,
$hostdata = {},
) inherits bmcremote::params {
# validate parameters here
class { 'bmcremote::install': } ->
class { 'bmcremote::config': } ->
Class["bmcremote"]
$host_keys = keys($hostdata)
$host_resources = prefix($host_keys, 'bmcremote_host_')
bmcremote::host { $host_resources:
data => $hostdata,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment