File: authn_dbd.pp

package info (click to toggle)
puppet-module-puppetlabs-apache 12.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,664 kB
  • sloc: ruby: 275; sh: 32; makefile: 2
file content (70 lines) | stat: -rw-r--r-- 2,164 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# @summary
#   Installs `mod_authn_dbd`.
# 
# @param authn_dbd_params
#   The params needed for the mod to function.
#   
# @param authn_dbd_dbdriver
#   Selects an apr_dbd driver by name.
#   
# @param authn_dbd_query
#   
# @param authn_dbd_min
#   Set the minimum number of connections per process.
#   
# @param authn_dbd_max
#   Set the maximum number of connections per process.
#   
# @param authn_dbd_keep
#   Set the maximum number of connections per process to be sustained.
#   
# @param authn_dbd_exptime
#   Set the time to keep idle connections alive when the number of 
#   connections specified in DBDKeep has been exceeded.
#   
# @param authn_dbd_alias
#   Sets an alias for `AuthnProvider.
#
# @see https://httpd.apache.org/docs/current/mod/mod_authn_dbd.html for additional documentation.
#
class apache::mod::authn_dbd (
  Optional[String] $authn_dbd_params,
  String $authn_dbd_dbdriver         = 'mysql',
  Optional[String] $authn_dbd_query  = undef,
  Integer $authn_dbd_min             = 4,
  Integer $authn_dbd_max             = 20,
  Integer $authn_dbd_keep            = 8,
  Integer $authn_dbd_exptime         = 300,
  Optional[String] $authn_dbd_alias  = undef,
) inherits apache::params {
  include apache
  include apache::mod::dbd
  ::apache::mod { 'authn_dbd': }

  if $authn_dbd_alias {
    include apache::mod::authn_core
  }

  $parameters = {
    'authn_dbd_dbdriver'  => $authn_dbd_dbdriver,
    'authn_dbd_params'    => $authn_dbd_params,
    'authn_dbd_min'       => $authn_dbd_min,
    'authn_dbd_max'       => $authn_dbd_max,
    'authn_dbd_keep'      => $authn_dbd_keep,
    'authn_dbd_exptime'   => $authn_dbd_exptime,
    'authn_dbd_alias'     => $authn_dbd_alias,
    'authn_dbd_query'     => $authn_dbd_query,
  }

  # Template uses
  # - All variables beginning with authn_dbd
  file { 'authn_dbd.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/authn_dbd.conf",
    mode    => $apache::file_mode,
    content => epp('apache/mod/authn_dbd.conf.epp', $parameters),
    require => [Exec["mkdir ${apache::mod_dir}"],],
    before  => File[$apache::mod_dir],
    notify  => Class['Apache::Service'],
  }
}