Browse Source

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
tags/0.1.0
Dan Bode 7 years ago
parent
commit
52aae65a4c
4 changed files with 11 additions and 7 deletions
  1. 2
    2
      examples/single.pp
  2. 2
    0
      manifests/api/config.pp
  3. 3
    3
      manifests/db/mysql.pp
  4. 4
    2
      manifests/db/mysql/host_access.pp

+ 2
- 2
examples/single.pp View File

@@ -40,7 +40,7 @@ node glance_keystone_mysql {
40 40
     log_debug    => true,
41 41
     catalog_type => 'sql',
42 42
   }->
43
-  class { 'keystone::mysql':
43
+  class { 'keystone::db::mysql':
44 44
     password => 'keystone',
45 45
   }->
46 46
   class { 'keystone::roles::admin': }
@@ -90,7 +90,7 @@ class role_glance_mysql {
90 90
   }
91 91
   class { 'glance::backend::file': }
92 92
 
93
-  class { 'glance::db':
93
+  class { 'glance::db::mysql':
94 94
     password => 'glance',
95 95
     dbname   => 'glance',
96 96
     user     => 'glance',

+ 2
- 0
manifests/api/config.pp View File

@@ -11,10 +11,12 @@ define glance::api::config(
11 11
   $content   = template("glance/api/${name}.erb"),
12 12
   $order     = undef
13 13
 ) {
14
+
14 15
   concat::fragment { "glance-api-${name}":
15 16
     target  => '/etc/glance/glance-api.conf',
16 17
     content => $content,
17 18
     order   => $order,
18 19
   }
20
+
19 21
 }
20 22
 

manifests/db.pp → manifests/db/mysql.pp View File

@@ -2,7 +2,7 @@
2 2
 # I should change this to mysql
3 3
 # for consistency
4 4
 #
5
-class glance::db(
5
+class glance::db::mysql(
6 6
   $password,
7 7
   $dbname = 'glance',
8 8
   $user = 'glance',
@@ -11,7 +11,7 @@ class glance::db(
11 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 15
   Database[$dbname] ~> Exec<| title == 'glance-manage db_sync' |>
16 16
 
17 17
   require 'mysql::python'
@@ -27,7 +27,7 @@ class glance::db(
27 27
 
28 28
   if $allowed_hosts {
29 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 31
       user      => $user,
32 32
       password  => $password,
33 33
       database  => $dbname,

manifests/db/host_access.pp → manifests/db/mysql/host_access.pp View File

@@ -1,5 +1,7 @@
1
-# db/allowed_hosts.pp
2
-define glance::db::host_access ($user, $password, $database)  {
1
+#
2
+# Used to grant access to the glance mysql DB
3
+#
4
+define glance::db::mysql::host_access ($user, $password, $database)  {
3 5
   database_user { "${user}@${name}":
4 6
     password_hash => mysql_password($password),
5 7
     provider => 'mysql',

Loading…
Cancel
Save