66
67
68
69
70
71
72
73
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
107
|
# File 'manifests/resource/map.pp', line 66
define nginx::resource::map (
String[2] $string,
Nginx::StringMappings $mappings = [],
Optional[String] $default = undef,
Enum['absent', 'present'] $ensure = 'present',
Array[String] $include_files = [],
Boolean $hostnames = false,
Enum['http', 'stream'] $context = 'http',
) {
if ! defined(Class['nginx']) {
fail('You must include the nginx base class before using any defined resources')
}
$root_group = $nginx::root_group
$conf_dir = $context ? {
'stream' => "${nginx::conf_dir}/conf.stream.d",
'http' => "${nginx::conf_dir}/conf.d",
}
$ensure_real = $ensure ? {
'absent' => absent,
default => 'file',
}
file { "${conf_dir}/${name}-map.conf":
ensure => $ensure_real,
owner => 'root',
group => $root_group,
mode => $nginx::global_mode,
content => epp('nginx/conf.d/map.epp', {
'default' => $default,
'hostnames' => $hostnames,
'include_files' => $include_files,
'mappings' => $mappings,
'name' => $name,
'string' => $string,
}),
notify => Class['nginx::service'],
tag => 'nginx_config_file',
}
}
|