Last active
August 29, 2015 14:23
-
-
Save beddari/513882f6a5f94b7d724c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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