aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/subsystems/database.pp7
1 files changed, 4 insertions, 3 deletions
diff --git a/manifests/subsystems/database.pp b/manifests/subsystems/database.pp
index c2d1fc3..445b656 100644
--- a/manifests/subsystems/database.pp
+++ b/manifests/subsystems/database.pp
@@ -2,18 +2,19 @@ class database {
include mysql::server
# Database definitions
- define instance($password) {
+ define instance($password, $ensure = present) {
mysql_database { "$name":
- ensure => present,
+ ensure => $ensure,
}
mysql_user { "$name@%":
+ ensure => $ensure,
password_hash => mysql_password($password),
- ensure => present,
require => Mysql_database["$name"],
}
mysql_grant { "$name@%/$name":
+ ensure => $ensure,
privileges => all,
require => Mysql_user["$name@%"],
}