* Add a defined type to manage IPMI's user and channel.
This commit is contained in:
parent
4eb0027c72
commit
22f665ad77
@ -10,4 +10,4 @@
|
||||
* Ensure needed modules load at boot time
|
||||
* Load one needed module (for Debian) one time
|
||||
* Update README.md file.
|
||||
* Add a defined type to manage IPMI's user.
|
||||
* Add a defined type to manage IPMI's user and channel.
|
||||
|
34
manifests/ressource/channel.pp
Normal file
34
manifests/ressource/channel.pp
Normal file
@ -0,0 +1,34 @@
|
||||
# == Define: ipmi::ressource::channel
|
||||
#
|
||||
# Manage channel's configuration
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*channel_id*]
|
||||
#
|
||||
define ipmi::ressource::channel ( $channel_id = $title, $ipaddr = '0.0.0.0', $netmask = '0.0.0.0', $remote_access = 'on' ) {
|
||||
|
||||
Exec {
|
||||
path => ['/bin','/sbin','/usr/bin','/usr/sbin'],
|
||||
logoutput => 'on_failure',
|
||||
}
|
||||
|
||||
# Set IP Address
|
||||
exec { "IPMI set IP ${ipaddr}":
|
||||
command => "ipmitool -I open lan set ${channel_id} ipaddr ${ipaddr}",
|
||||
unless => "ipmitool -I open lan print ${channel_id} | grep '^IP .* ${ipaddr}'",
|
||||
}
|
||||
->
|
||||
# Set Netmask
|
||||
exec { "IPMI set MASK ${netmask}":
|
||||
command => "ipmitool -I open lan set ${channel_id} netmask ${netmask}",
|
||||
unless => "ipmitool -I open lan print ${channel_id} | grep 'Mask .* ${netmask}'",
|
||||
}
|
||||
->
|
||||
# Enable remote access
|
||||
exec { "IPMI set remote access to ${remote_access} for channel ${channel_id}":
|
||||
command => "ipmitool -I open lan set ${channel_id} access ${remote_access}",
|
||||
onlyif => "ipmitool -I open channel info ${channel_id} | grep -i 'Access Mode .* disable'",
|
||||
}
|
||||
|
||||
} # Public ressource: ipmi::ressource::channel
|
@ -30,6 +30,7 @@
|
||||
# Ensure this user is +enable+ or +disable+.
|
||||
#
|
||||
define ipmi::ressource::user ( $user = $title, $password, $user_id = '2', $channel_id = '1', $state = 'enable' ) {
|
||||
|
||||
Exec {
|
||||
path => ['/bin','/sbin','/usr/bin','/usr/sbin'],
|
||||
logoutput => 'on_failure',
|
||||
|
Loading…
Reference in New Issue
Block a user