From 5cbb8d3a852d6360c3935d183e85ccb74e283ec6 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Thu, 21 Mar 2013 20:44:50 +0000 Subject: [PATCH] Adding functionality to mysql --- mysql.yaml | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/mysql.yaml b/mysql.yaml index 722cff87..f8d92627 100644 --- a/mysql.yaml +++ b/mysql.yaml @@ -9,14 +9,30 @@ Parameters: Description: Use this flavor Type: String Default: bm.small + KeystoneUser: + Description: Keystone database username. + Type: String + Default: keystone MySQLImage: Type: String - BootstrapUrl: - Description: Fetch a mysql dump file from this URL and load it + BootstrapHost: + Description: Load mysqldump from this Host + Type: String + Default: '' + BootstrapRootPassword: + Description: Root password for localhost access after bootstrap + Type: String + Default: '' + BootstrapDumpPassword: + Description: Password to use for mysqldump from Bootstrap Host + Type: String + Default: '' + BootstrapSlaveUser: + Description: User to use for replication from bootstrap host Type: String Default: '' - BootstrapRootCnfUrl: - Description: Fetch a mysql config file from this URL to setup local root with bootstrapped database + BootstrapSlavePassword: + Description: Password to use with BootstrapSlaveUser Type: String Default: '' Resources: @@ -40,9 +56,17 @@ Resources: OpenStack::Config: mysql: users: + root: + password: {Ref: BootstrapRootPassword} + dump: + password: {Ref: BootstrapDumpPassword} + create-users: - database: keystone - bootstrap_url: {Ref: BootstrapUrl} - root_cnf_url: {Ref: BootstrapRootCnfUrl} + username: {Ref: KeystoneUser} + userhandle: {Ref: KeystonePasswordHandle} + bootstrap_host: {Ref: BootstrapHost} + slave_user: {Ref: BootstrapSlaveUser} + slave_password: {Ref: BootstrapSlavePassword} heat: access_key_id: Ref: ApiKey @@ -59,6 +83,17 @@ Resources: InstanceType: {Ref: InstanceType} KeyName: {Ref: KeyName} UserData: "#!/bin/bash\ntouch /tmp/userdata-finished\necho Userdata finished $(date)\n" + KeystonePasswordHandle: + Type: AWS::CloudFormation::WaitConditionHandle + KeystonePassword: + DependsOn: MySQL + Type: AWS::CloudFormation::WaitCondition + Properties: + Handle: {Ref: KeystonePasswordHandle} + Timeout: 60 Outputs: MySQLHost: Fn::GetAtt: [ MySQL , PrivateIp ] + KeystonePassword: + Fn::GetAtt: [ KeystonePassword, Data ] + KeystoneUser: {Ref: KeystoneUser} -- 2.16.6