* Add the possibility to choose between static, dhcp, bios or none for the channel network configuration.
This commit is contained in:
parent
a8d67c7915
commit
fc1c6576eb
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
##### Changes
|
##### Changes
|
||||||
* Correct some warnings from Puppet-lint.
|
* Correct some warnings from Puppet-lint.
|
||||||
|
* Add the possibility to choose between static, dhcp, bios or none for the channel network configuration.
|
||||||
|
|
||||||
##### Bugfixes
|
##### Bugfixes
|
||||||
* #2 Add a test for ipmi::ressource::user
|
* #2 Add a test for ipmi::ressource::user
|
||||||
|
@ -24,13 +24,15 @@
|
|||||||
#
|
#
|
||||||
# Allow remote access from lan (+on+) or disable it (+off+).
|
# Allow remote access from lan (+on+) or disable it (+off+).
|
||||||
#
|
#
|
||||||
define ipmi::ressource::channel ( $channel_id = $title, $ipaddr = '0.0.0.0', $netmask = '0.0.0.0', $remote_access = 'on' ) {
|
define ipmi::ressource::channel ( $channel_id = $title, $ipsrc = 'static', $ipaddr = '0.0.0.0', $netmask = '0.0.0.0', $remote_access = 'on' ) {
|
||||||
|
|
||||||
Exec {
|
Exec {
|
||||||
path => ['/bin','/sbin','/usr/bin','/usr/sbin'],
|
path => ['/bin','/sbin','/usr/bin','/usr/sbin'],
|
||||||
logoutput => 'on_failure',
|
logoutput => 'on_failure',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case $ipsrc {
|
||||||
|
'static': {
|
||||||
# Set IP Address
|
# Set IP Address
|
||||||
exec { "IPMI set IP ${ipaddr}":
|
exec { "IPMI set IP ${ipaddr}":
|
||||||
command => "ipmitool -I open lan set ${channel_id} ipaddr ${ipaddr}",
|
command => "ipmitool -I open lan set ${channel_id} ipaddr ${ipaddr}",
|
||||||
@ -42,6 +44,26 @@ define ipmi::ressource::channel ( $channel_id = $title, $ipaddr = '0.0.0.0', $ne
|
|||||||
command => "ipmitool -I open lan set ${channel_id} netmask ${netmask}",
|
command => "ipmitool -I open lan set ${channel_id} netmask ${netmask}",
|
||||||
unless => "ipmitool -I open lan print ${channel_id} | grep 'Mask .* ${netmask}'",
|
unless => "ipmitool -I open lan print ${channel_id} | grep 'Mask .* ${netmask}'",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
default: {
|
||||||
|
# Nothing to do
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set the IP Address source for the channel
|
||||||
|
exec { "Set ${ipsrc} IP for channel ${channel_id}":
|
||||||
|
command => "ipmitool -I open lan set ${channel_id} ipsrc ${ipsrc}",
|
||||||
|
unless => $ipsrc ? {
|
||||||
|
'static' => "ipmitool lan print ${channel_id} | grep -i '^IP Address Source.* Static'",
|
||||||
|
'dhcp' => "ipmitool lan print ${channel_id} | grep -i '^IP Address Source.* DHCP'",
|
||||||
|
'bios' => "ipmitool lan print ${channel_id} | grep -i '^IP Address Source.* BIOS'",
|
||||||
|
'none' => "ipmitool lan print ${channel_id} | grep -i '^IP Address Source.* Unspecified'",
|
||||||
|
}
|
||||||
|
}
|
||||||
->
|
->
|
||||||
# Enable remote access
|
# Enable remote access
|
||||||
exec { "IPMI set remote access to ${remote_access} for channel ${channel_id}":
|
exec { "IPMI set remote access to ${remote_access} for channel ${channel_id}":
|
||||||
|
Loading…
Reference in New Issue
Block a user