Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #38 from galthaus/pull-req-master-285d186c88

Merge rails3anddb into development [15/29]
  • Loading branch information...
commit b84156fc64dbc90b4bcac8aee9941b63b3301901 2 parents 529e8a8 + 285d186
@galthaus galthaus authored
View
19 crowbar.yml
@@ -19,33 +19,18 @@ barclamp:
name: keystone
display: OpenStack Keystone
version: 0
+ allow_multiple_proposals: true
requires:
- mysql
member:
- openstack
crowbar:
- layout: 1
+ layout: 2
order: 75
run_order: 75
chef_order: 75
-locale_additions:
- en:
- barclamp:
- keystone:
- edit_deployment:
- deployment: Deployment
- edit_attributes:
- attributes: Attributes
- sql_engine: SQL Engine
- mysql_instance: MySQL Instance
- default-tenant: Default Tenant
- admin-username: Administrator Username
- admin-password: Administrator Password
- default-username: Regular User Username
- default-password: Regular User Password
-
debs:
ubuntu-10.10:
repos:
View
3  crowbar_framework/app/controllers/keystone_controller.rb
@@ -14,8 +14,5 @@
#
class KeystoneController < BarclampController
- def initialize
- @service_object = KeystoneService.new logger
- end
end
View
48 crowbar_framework/app/models/keystone_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,19 +15,11 @@
class KeystoneService < ServiceObject
- def initialize(thelogger)
- @bc_name = "keystone"
- @logger = thelogger
- end
-
- def self.allow_multiple_proposals?
- true
- end
-
- def proposal_dependencies(role)
+ def proposal_dependencies(prop_config)
answer = []
- if role.default_attributes["keystone"]["sql_engine"] == "mysql"
- answer << { "barclamp" => "mysql", "inst" => role.default_attributes["keystone"]["mysql_instance"] }
+ hash = prop_config.config_hash
+ if hash["keystone"]["sql_engine"] == "mysql"
+ answer << { "barclamp" => "mysql", "inst" => hash["mysql_instance"] }
end
answer
end
@@ -35,32 +27,34 @@ def proposal_dependencies(role)
def create_proposal
base = super
- nodes = NodeObject.all
- nodes.delete_if { |n| n.nil? or n.admin? }
+ nodes = Node.all
+ nodes.delete_if { |n| n.nil? or n.is_admin? }
+ if nodes.size >= 1
+ add_role_to_instance_and_node(n[0].name, base.name, "keystone-server")
+ end
- base["attributes"]["keystone"]["mysql_instance"] = ""
+ hash = base.config_hash
+ hash["keystone"]["mysql_instance"] = ""
begin
- mysqlService = MysqlService.new(@logger)
+ mysql = Barclamp.find_by_name("mysql")
# Look for active roles
- mysqls = mysqlService.list_active[1]
+ mysqls = mysql.active_proposals
if mysqls.empty?
# No actives, look for proposals
- mysqls = mysqlService.proposals[1]
+ mysqls = mysql.proposals
end
unless mysqls.empty?
- base["attributes"]["keystone"]["mysql_instance"] = mysqls[0]
+ hash["keystone"]["mysql_instance"] = mysqls[0].name
end
- base["attributes"]["keystone"]["sql_engine"] = "mysql"
+ hash["keystone"]["sql_engine"] = "mysql"
rescue
@logger.info("Keystone create_proposal: no mysql found")
- base["attributes"]["keystone"]["sql_engine"] = "mysql"
+ hash["keystone"]["sql_engine"] = "mysql"
end
-
- base["deployment"]["keystone"]["elements"] = {
- "keystone-server" => [ nodes.first[:fqdn] ]
- } unless nodes.nil? or nodes.length ==0
- base[:attributes][:keystone][:service][:token] = '%012d' % rand(1e12)
+ hash["keystone"][:service][:token] = '%012d' % rand(1e12)
+
+ base.config_hash = hash
base
end
View
29 crowbar_framework/config/locales/keystone/en.yml
@@ -0,0 +1,29 @@
+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:
+ keystone:
+ edit_deployment:
+ deployment: Deployment
+ edit_attributes:
+ attributes: Attributes
+ sql_engine: SQL Engine
+ mysql_instance: MySQL Instance
+ default-tenant: Default Tenant
+ admin-username: Administrator Username
+ admin-password: Administrator Password
+ default-username: Regular User Username
+ default-password: Regular User Password
+
View
24 crowbar_framework/db/migrate/20120802030000_barclamp_import_keystone.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 BarclampImportKeystone < ActiveRecord::Migration
+ def up
+ Barclamp.import_1x 'keystone'
+ end
+
+ def down
+ Barclamp.delete(Barclamp.find_by_name 'keystone')
+ end
+
+end
View
5 crowbar_framework/doc/default/keystone/barclamp-info.md
@@ -0,0 +1,5 @@
+### Keystone Barclamp
+
+This barclamp does...
+
+
View
10 crowbar_framework/doc/default/keystone/licenses.md
@@ -0,0 +1,10 @@
+### Keystone 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:
+
+* ?
+
+
+
View
11 crowbar_framework/doc/keystone.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:
+ keystone+barclamp-info
+
+crowbar+book-licenses:
+ openstack+licenses-openstack-meta:
+ keystone+licenses
Please sign in to comment.
Something went wrong with that request. Please try again.