From 7a308c164e2744384e9661f8655503e682e99271 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Mon, 9 Feb 2015 11:43:13 +0100 Subject: [PATCH] * (#1) If the remote_access for a channel is set to 'off', the ressource disable it. --- CHANGELOG.md | 7 +++++++ manifests/ressource/channel.pp | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bd47f5..c54c3f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ --------------------------------------- +### + +##### Changes +* (#1) If the remote_access for a channel is set to 'off', the ressource disable it. + +--------------------------------------- + ### 0.1.1 - 2015/01/20 Minor release to correct some mistakes. diff --git a/manifests/ressource/channel.pp b/manifests/ressource/channel.pp index d1351c3..176f946 100644 --- a/manifests/ressource/channel.pp +++ b/manifests/ressource/channel.pp @@ -45,8 +45,11 @@ define ipmi::ressource::channel ( $channel_id = $title, $ipaddr = '0.0.0.0', $ne -> # 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'", + command => "ipmitool -I open lan set ${channel_id} access ${remote_access}", + onlyif => $remote_access ? { + 'off' => "ipmitool -I open channel info ${channel_id} | grep -i 'Access Mode .* available'", + default => "ipmitool -I open channel info ${channel_id} | grep -i 'Access Mode .* disable'", + }, } } # Public ressource: ipmi::ressource::channel