Skip to content
Permalink
Browse files

Merge pull request #485 from s-t-e-v-e-n-k/trove-random-password

Set the trove service password to random
  • Loading branch information...
vuntz committed Aug 31, 2016
2 parents 7b8bcc5 + cdaa9ec commit 208230bdfbcb19d062149d083b1a66b429516a69
@@ -0,0 +1,16 @@
def upgrade(ta, td, a, d)
# Use a class variable, since migrations are run twice.
unless defined?(@@trove_service_password)
service = ServiceObject.new "fake-logger"
@@trove_service_password = service.random_password
end
a["service_user"] = ta["service_user"]
a["service_password"] = @@trove_service_password
return a, d
end

def downgrade(ta, td, a, d)
a.delete("service_user")
a.delete("service_password")
return a, d
end
@@ -11,6 +11,7 @@
"cinder_instance": "none",
"rabbitmq_instance": "none",
"volume_support": false,
"service_user": "trove",
"db": {
"password": "",
"user": "trove",
@@ -27,7 +28,7 @@
"trove": {
"crowbar-revision": 1,
"crowbar-applied": false,
"schema-revision": 100,
"schema-revision": 101,
"element_states": {
"trove-server": [ "readying", "ready", "applying" ]
},
@@ -20,6 +20,8 @@
"swift_instance": { "type": "str", "required": true },
"rabbitmq_instance": { "type": "str", "required": true },
"volume_support": { "type": "bool", "required": true },
"service_user": { "type": "str", "required": true },
"service_password": { "type": "str" },
"db": {
"type": "map",
"required": true,
@@ -45,6 +45,7 @@ def create_proposal
base["attributes"][@bc_name]["swift_instance"] = find_dep_proposal("swift", true)
base["attributes"][@bc_name]["rabbitmq_instance"] = find_dep_proposal("rabbitmq")
base["attributes"][@bc_name]["db"]["password"] = random_password
base["attributes"][@bc_name]["service_password"] = random_password

# assign a default node to the trove-server role
nodes = NodeObject.all

0 comments on commit 208230b

Please sign in to comment.
You can’t perform that action at this time.