diff --git a/chef/data_bags/crowbar/bc-template-ipmi.json b/chef/data_bags/crowbar/bc-template-ipmi.json index 0cd95e1..bf668fb 100755 --- a/chef/data_bags/crowbar/bc-template-ipmi.json +++ b/chef/data_bags/crowbar/bc-template-ipmi.json @@ -18,7 +18,7 @@ }, "elements": {}, "element_order": [ - [ "ipmi-configure" ] + [ "ipmi-discover", "ipmi-configure" ] ], "config": { "environment": "ipmi-base-config", diff --git a/crowbar.yml b/crowbar.yml index 776f3c2..9ac4329 100644 --- a/crowbar.yml +++ b/crowbar.yml @@ -23,24 +23,11 @@ barclamp: - crowbar crowbar: - layout: 1 + layout: 2 order: 16 run_order: 16 chef_order: 16 -locale_additions: - en: - barclamp: - ipmi: - edit_attributes: - attributes: Attributes - debug: Enable Barclamp Debug - bmc_enable: Enable BMC - bmc_user: BMC User - bmc_password: BMC Password - edit_deployment: - deployment: Deployment - debs: pkgs: - ipmitool diff --git a/crowbar_framework/app/controllers/ipmi_controller.rb b/crowbar_framework/app/controllers/ipmi_controller.rb index d3a629a..ba902b9 100755 --- a/crowbar_framework/app/controllers/ipmi_controller.rb +++ b/crowbar_framework/app/controllers/ipmi_controller.rb @@ -14,7 +14,4 @@ # class IpmiController < BarclampController - def initialize - @service_object = IpmiService.new logger - end end diff --git a/crowbar_framework/app/models/ipmi_service.rb b/crowbar_framework/app/models/ipmi_service.rb index af6af59..bc2d20c 100755 --- a/crowbar_framework/app/models/ipmi_service.rb +++ b/crowbar_framework/app/models/ipmi_service.rb @@ -1,4 +1,4 @@ -# Copyright 2011, Dell +# Copyright 2012, Dell # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,18 +15,6 @@ class IpmiService < ServiceObject - def initialize(thelogger) - @bc_name = "ipmi" - @logger = thelogger - end - - def create_proposal - @logger.debug("IPMI create_proposal: entering") - base = super - @logger.debug("IPMI create_proposal: exiting") - base - end - def transition(inst, name, state) @logger.debug("IPMI transition: make sure that network role is on all nodes: #{name} for #{state}") @@ -35,11 +23,9 @@ def transition(inst, name, state) # if state == "discovering" @logger.debug("IPMI transition: discovering state for #{name} for #{state}") - db = ProposalObject.find_proposal "ipmi", inst - role = RoleObject.find_role_by_name "ipmi-config-#{inst}" - result = add_role_to_instance_and_node("ipmi", inst, name, db, role, "ipmi-discover") + result = add_role_to_instance_and_node(name, inst, "ipmi-discover") @logger.debug("ipmi transition: leaving from installed state for #{name} for #{state}") - a = [200, NodeObject.find_node_by_name(name).to_hash ] if result + a = [200, "" ] if result a = [400, "Failed to add role to node"] unless result return a end @@ -49,17 +35,15 @@ def transition(inst, name, state) # if state == "discovered" @logger.debug("IPMI transition: installed state for #{name} for #{state}") - db = ProposalObject.find_proposal "ipmi", inst - role = RoleObject.find_role_by_name "ipmi-config-#{inst}" - result = add_role_to_instance_and_node("ipmi", inst, name, db, role, "ipmi-configure") + result = add_role_to_instance_and_node(name, inst, "ipmi-configure") @logger.debug("ipmi transition: leaving from installed state for #{name} for #{state}") - a = [200, NodeObject.find_node_by_name(name).to_hash ] if result + a = [200, "" ] if result a = [400, "Failed to add role to node"] unless result return a end @logger.debug("ipmi transition: leaving for #{name} for #{state}") - [200, NodeObject.find_node_by_name(name).to_hash ] + [200, ""] end end diff --git a/crowbar_framework/config/locales/ipmi/en.yml b/crowbar_framework/config/locales/ipmi/en.yml new file mode 100755 index 0000000..4eccfe8 --- /dev/null +++ b/crowbar_framework/config/locales/ipmi/en.yml @@ -0,0 +1,25 @@ +# Copyright 2012, Dell +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +en: + barclamp: + ipmi: + edit_attributes: + attributes: Attributes + debug: Enable Barclamp Debug + bmc_enable: Enable BMC + bmc_user: BMC User + bmc_password: BMC Password + edit_deployment: + deployment: Deployment \ No newline at end of file diff --git a/crowbar_framework/db/migrate/20120801015033_barclamp_import_ipmi.rb b/crowbar_framework/db/migrate/20120801015033_barclamp_import_ipmi.rb new file mode 100644 index 0000000..20502d7 --- /dev/null +++ b/crowbar_framework/db/migrate/20120801015033_barclamp_import_ipmi.rb @@ -0,0 +1,24 @@ +# Copyright 2012, Dell +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +class BarclampImportIpmi < ActiveRecord::Migration + def up + Barclamp.import_1x 'ipmi' + end + + def down + Barclamp.delete(Barclamp.find_by_name 'ipmi') + end + +end diff --git a/crowbar_framework/doc/default/ipmi/barclamp-info.md b/crowbar_framework/doc/default/ipmi/barclamp-info.md new file mode 100755 index 0000000..0c1793f --- /dev/null +++ b/crowbar_framework/doc/default/ipmi/barclamp-info.md @@ -0,0 +1,5 @@ +### IPMI Barclamp + +This barclamp configures the IP Management Interfaces (aka BMC) used for remote console and power management. + + diff --git a/crowbar_framework/doc/default/ipmi/licenses.md b/crowbar_framework/doc/default/ipmi/licenses.md new file mode 100755 index 0000000..22a6948 --- /dev/null +++ b/crowbar_framework/doc/default/ipmi/licenses.md @@ -0,0 +1,10 @@ +### IPMI Barclamp Licenses + +This file contains information (if updated by the barclamp authors!) about the licenses that apply to your installation. + +The following dependencies are required: + +* ? + + + diff --git a/crowbar_framework/doc/ipmi.yml b/crowbar_framework/doc/ipmi.yml new file mode 100755 index 0000000..158b250 --- /dev/null +++ b/crowbar_framework/doc/ipmi.yml @@ -0,0 +1,11 @@ +# theses are the default meta_data values +license: Apache 2 +copyright: 2012 by Dell, Inc +date: July 25, 2012 + +crowbar+book-barclamps: + ipmi+barclamp-info + +crowbar+book-licenses: + crowbar+licenses-crowbar-meta: + ipmi+licenses \ No newline at end of file