Puppet Class: rsyslog::database

Inherits:
rsyslog
Defined in:
manifests/database.pp

Overview

Class: rsyslog::database

Full description of class role here.

Parameters

backend
  • Which backend server to use (mysql|pgsql)

server
  • Server hostname

database
  • Database name

username
  • Database username

password
  • Database password

Variables

Examples

class { 'rsyslog::database':
  backend  => 'mysql',
  server   => 'localhost',
  database => 'mydb',
  username => 'myuser',
  password => 'mypass',
}

Parameters:

  • backend (Any)
  • server (Any)
  • database (Any)
  • username (Any)
  • password (Any)


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'manifests/database.pp', line 25

class rsyslog::database (
  $backend,
  $server,
  $database,
  $username,
  $password
) inherits rsyslog {

  $db_module = "om${backend}"

  case $backend {
    'mysql': { $db_package = $rsyslog::mysql_package_name }
    'pgsql': { $db_package = $rsyslog::pgsql_package_name }
    default: { fail("Unsupported backend: ${backend}. Only MySQL (mysql) and PostgreSQL (pgsql) are supported.") }
  }

  package { $db_package:
    ensure => $rsyslog::package_status,
    before => Rsyslog::Snippet[$backend],
  }

  rsyslog::snippet { $backend:
    ensure    => present,
    file_mode => '0600',
    content   => template("${module_name}/database.conf.erb"),
  }

}