summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Bode <dan@puppetlabs.com>2012-04-22 23:51:48 -0700
committerDan Bode <dan@puppetlabs.com>2012-04-22 23:54:42 -0700
commit52aae65a4ca8a6ca9c717c99bac9c2a7dcc147d5 (patch)
tree8cec83022f93a1ec581d70bee65da0070dc0f844
parent827b302824c4dd8a9b3fbee30227cf973c925b66 (diff)
Move mysql code to db::mysql
This commit moves the mysql specific db manifests to the namespace glance::db::mysql. This is done for two reasons: - to create a directory loaction for manifests for all future supported datbases - to be consistent with other openstack projects
-rw-r--r--examples/single.pp4
-rw-r--r--manifests/api/config.pp2
-rw-r--r--manifests/db/mysql.pp (renamed from manifests/db.pp)6
-rw-r--r--manifests/db/mysql/host_access.pp (renamed from manifests/db/host_access.pp)6
4 files changed, 11 insertions, 7 deletions
diff --git a/examples/single.pp b/examples/single.pp
index 4a19435..62c8d11 100644
--- a/examples/single.pp
+++ b/examples/single.pp
@@ -40,7 +40,7 @@ node glance_keystone_mysql {
40 log_debug => true, 40 log_debug => true,
41 catalog_type => 'sql', 41 catalog_type => 'sql',
42 }-> 42 }->
43 class { 'keystone::mysql': 43 class { 'keystone::db::mysql':
44 password => 'keystone', 44 password => 'keystone',
45 }-> 45 }->
46 class { 'keystone::roles::admin': } 46 class { 'keystone::roles::admin': }
@@ -90,7 +90,7 @@ class role_glance_mysql {
90 } 90 }
91 class { 'glance::backend::file': } 91 class { 'glance::backend::file': }
92 92
93 class { 'glance::db': 93 class { 'glance::db::mysql':
94 password => 'glance', 94 password => 'glance',
95 dbname => 'glance', 95 dbname => 'glance',
96 user => 'glance', 96 user => 'glance',
diff --git a/manifests/api/config.pp b/manifests/api/config.pp
index 1e48c2d..dc9e74f 100644
--- a/manifests/api/config.pp
+++ b/manifests/api/config.pp
@@ -11,10 +11,12 @@ define glance::api::config(
11 $content = template("glance/api/${name}.erb"), 11 $content = template("glance/api/${name}.erb"),
12 $order = undef 12 $order = undef
13) { 13) {
14
14 concat::fragment { "glance-api-${name}": 15 concat::fragment { "glance-api-${name}":
15 target => '/etc/glance/glance-api.conf', 16 target => '/etc/glance/glance-api.conf',
16 content => $content, 17 content => $content,
17 order => $order, 18 order => $order,
18 } 19 }
20
19} 21}
20 22
diff --git a/manifests/db.pp b/manifests/db/mysql.pp
index d0a1819..3a06298 100644
--- a/manifests/db.pp
+++ b/manifests/db/mysql.pp
@@ -2,7 +2,7 @@
2# I should change this to mysql 2# I should change this to mysql
3# for consistency 3# for consistency
4# 4#
5class glance::db( 5class glance::db::mysql(
6 $password, 6 $password,
7 $dbname = 'glance', 7 $dbname = 'glance',
8 $user = 'glance', 8 $user = 'glance',
@@ -11,7 +11,7 @@ class glance::db(
11 $cluster_id = 'localzone' 11 $cluster_id = 'localzone'
12) { 12) {
13 13
14 Class['glance::db'] -> Exec<| title == 'glance-manage db_sync' |> 14 Class['glance::db::mysql'] -> Exec<| title == 'glance-manage db_sync' |>
15 Database[$dbname] ~> Exec<| title == 'glance-manage db_sync' |> 15 Database[$dbname] ~> Exec<| title == 'glance-manage db_sync' |>
16 16
17 require 'mysql::python' 17 require 'mysql::python'
@@ -27,7 +27,7 @@ class glance::db(
27 27
28 if $allowed_hosts { 28 if $allowed_hosts {
29 # TODO this class should be in the mysql namespace 29 # TODO this class should be in the mysql namespace
30 glance::db::host_access { $allowed_hosts: 30 glance::db::mysql::host_access { $allowed_hosts:
31 user => $user, 31 user => $user,
32 password => $password, 32 password => $password,
33 database => $dbname, 33 database => $dbname,
diff --git a/manifests/db/host_access.pp b/manifests/db/mysql/host_access.pp
index 355da0d..92dcfe8 100644
--- a/manifests/db/host_access.pp
+++ b/manifests/db/mysql/host_access.pp
@@ -1,5 +1,7 @@
1# db/allowed_hosts.pp 1#
2define glance::db::host_access ($user, $password, $database) { 2# Used to grant access to the glance mysql DB
3#
4define glance::db::mysql::host_access ($user, $password, $database) {
3 database_user { "${user}@${name}": 5 database_user { "${user}@${name}":
4 password_hash => mysql_password($password), 6 password_hash => mysql_password($password),
5 provider => 'mysql', 7 provider => 'mysql',