File: rule_link.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 (21 lines) | stat: -rw-r--r-- 605 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
# @summary
#   Links the activated_rules from `apache::mod::security` to the respective CRS rules on disk.
#
# @api private
define apache::security::rule_link {
  $parts = split($title, '/')
  $filename = $parts[-1]

  $target = $title ? {
    /^\//   => $title,
    default => "${apache::params::modsec_crs_path}/${title}",
  }

  file { $filename:
    ensure  => 'link',
    path    => "${apache::mod::security::modsec_dir}/activated_rules/${filename}",
    target  => $target ,
    require => File["${apache::mod::security::modsec_dir}/activated_rules"],
    notify  => Class['apache::service'],
  }
}