File: nss.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 (53 lines) | stat: -rw-r--r-- 1,365 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
# @summary
#   Installs and configures `mod_nss`.
# 
# @param transfer_log
#   Path to `access.log`.
#
# @param error_log
#   Path to `error.log`
#
# @param passwd_file
#   Path to file containing token passwords used for NSSPassPhraseDialog.
#
# @param port
#   Sets the SSL port that should be used by mod_nss.
# 
# @see https://pagure.io/mod_nss for additional documentation.
#
class apache::mod::nss (
  Stdlib::Absolutepath $transfer_log = "${apache::params::logroot}/access.log",
  Stdlib::Absolutepath $error_log    = "${apache::params::logroot}/error.log",
  Optional[String] $passwd_file      = undef,
  Stdlib::Port $port                 = 8443,
) {
  include apache
  include apache::mod::mime

  apache::mod { 'nss': }

  $httpd_dir = $apache::httpd_dir

  # Template uses:
  # $transfer_log
  # $error_log
  # $http_dir
  # passwd_file
  $parameters = {
    'port'          => $port,
    'passwd_file'   => $passwd_file,
    'error_log'     => $error_log,
    'transfer_log'  => $transfer_log,
    'httpd_dir'     => $httpd_dir,
  }

  file { 'nss.conf':
    ensure  => file,
    path    => "${apache::mod_dir}/nss.conf",
    mode    => $apache::file_mode,
    content => epp('apache/mod/nss.conf.epp', $parameters),
    require => Exec["mkdir ${apache::mod_dir}"],
    before  => File[$apache::mod_dir],
    notify  => Class['apache::service'],
  }
}