74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'manifests/resource/map.pp', line 74
define nginx::resource::map (
String[2] $string,
Variant[Array, Hash] $mappings,
Optional[String] $default = undef,
Enum['absent', 'present'] $ensure = 'present',
Array[String] $include_files = [],
Boolean $hostnames = false
) {
if ! defined(Class['nginx']) {
fail('You must include the nginx base class before using any defined resources')
}
$root_group = $nginx::root_group
$conf_dir = "${nginx::conf_dir}/conf.d"
$ensure_real = $ensure ? {
'absent' => absent,
default => 'file',
}
File {
owner => 'root',
group => $root_group,
mode => '0644',
}
file { "${nginx::conf_dir}/conf.d/${name}-map.conf":
ensure => $ensure_real,
content => template('nginx/conf.d/map.erb'),
notify => Class['nginx::service'],
require => File[$conf_dir],
}
}
|