Skip to content

Commit

Permalink
Merge pull request crowbar#21 from galthaus/pull-req-master-ab0a7d9fef
Browse files Browse the repository at this point in the history
Merge rails3anddb into development [7/29]
  • Loading branch information
galthaus committed Aug 25, 2012
2 parents 77854d8 + ab0a7d9 commit 547f4fe
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 40 deletions.
2 changes: 1 addition & 1 deletion chef/data_bags/crowbar/bc-template-ipmi.json
Expand Up @@ -18,7 +18,7 @@
},
"elements": {},
"element_order": [
[ "ipmi-configure" ]
[ "ipmi-discover", "ipmi-configure" ]
],
"config": {
"environment": "ipmi-base-config",
Expand Down
15 changes: 1 addition & 14 deletions crowbar.yml
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions crowbar_framework/app/controllers/ipmi_controller.rb
Expand Up @@ -14,7 +14,4 @@
#

class IpmiController < BarclampController
def initialize
@service_object = IpmiService.new logger
end
end
28 changes: 6 additions & 22 deletions 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.
Expand All @@ -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}")

Expand All @@ -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
Expand All @@ -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
25 changes: 25 additions & 0 deletions 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
@@ -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
5 changes: 5 additions & 0 deletions 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.


10 changes: 10 additions & 0 deletions 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:

* ?



11 changes: 11 additions & 0 deletions 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

0 comments on commit 547f4fe

Please sign in to comment.