-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #66 add database mangement for icingadb, add redis base class
- Loading branch information
Showing
4 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# @summary | ||
# Setup database for IcingaDB. | ||
# | ||
# @param [Enum['mysql','pgsql']] db_type | ||
# What kind of database type to use. | ||
# | ||
# @param [Array[Stdlib::Host]] icingadb_instances | ||
# List of Hosts to allow write access to the database. Usually an IcingaDB instance. | ||
# | ||
# @param [String] db_pass | ||
# Password to connect the database. | ||
# | ||
# @param [String] db_name | ||
# Name of the database. | ||
# | ||
# @param [String] db_user | ||
# Database user name. | ||
# | ||
class icinga::db::database( | ||
Enum['mysql','pgsql'] $db_type, | ||
Array[Stdlib::Host] $icingadb_instances, | ||
String $db_pass, | ||
String $db_name = 'icingadb', | ||
String $db_user = 'icingadb', | ||
) { | ||
|
||
$_db_encoding = $db_type ? { | ||
'mysql' => 'utf8', | ||
default => 'UTF8', | ||
} | ||
|
||
::icinga::database { "${db_type}-${db_name}": | ||
db_type => $db_type, | ||
db_name => $db_name, | ||
db_user => $db_user, | ||
db_pass => $db_pass, | ||
access_instances => $icingadb_instances, | ||
mysql_privileges => ['ALL'], | ||
db_encoding => $_db_encoding, | ||
} | ||
|
||
if $db_type == 'pgsql' { | ||
postgresql::server::extension { "${db_name}-citext": | ||
extension => 'citext', | ||
database => $db_name, | ||
package_name => 'postgresql-contrib', | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class icinga::redis { | ||
class { 'redis': | ||
manage_repo => false, | ||
manage_package => false, | ||
default_install => false, | ||
ulimit_managed => false, | ||
service_manage => false, | ||
config_owner => 'root', | ||
config_group => 'root', | ||
service_user => 'root', | ||
service_group => 'root', | ||
} | ||
} |