39 lines
1.5 KiB
Puppet
39 lines
1.5 KiB
Puppet
# manage a nginx proxy with a wraoper module
|
|
class nginxproxy (
|
|
Stdlib::Fqdn $nginx_vhost = $nginxproxy::params::nginx_vhost,
|
|
Array[Stdlib::Host] $nginx_aliases = $nginxproxy::params::nginx_aliases,
|
|
Stdlib::Port $nginx_port = $nginxproxy::params::nginx_port,
|
|
Stdlib::Port $nginx_ssl_port = $nginxproxy::params::nginx_ssl_port,
|
|
Enum['http','https','both'] $nginx_listen_mode = $nginxproxy::params::nginx_listen_mode,
|
|
Enum['puppet', 'vault'] $nginx_cert_type = $nginxproxy::params::nginx_cert_type,
|
|
Enum['http','https'] $proxy_scheme = $nginxproxy::params::proxy_scheme,
|
|
Stdlib::Port $proxy_port = $nginxproxy::params::proxy_port,
|
|
Stdlib::Host $proxy_host = $nginxproxy::params::proxy_host,
|
|
String $proxy_path = $nginxproxy::params::proxy_path,
|
|
Boolean $simple_mode = $nginxproxy::params::simple_mode,
|
|
Array[Hash] $locations = $nginxproxy::params::locations,
|
|
Boolean $manage_auth_ldap = $nginxproxy::params::manage_auth_ldap,
|
|
Stdlib::Absolutepath $auth_ldap_config = $nginxproxy::params::auth_ldap_config,
|
|
Hash $auth_ldap_params = $nginxproxy::params::auth_ldap_params,
|
|
) {
|
|
|
|
if ! $facts['nginx_version'] {
|
|
package { 'nginx':
|
|
ensure => 'present',
|
|
}
|
|
} else {
|
|
include nginxproxy::config
|
|
include nginxproxy::selinux
|
|
|
|
if $manage_auth_ldap {
|
|
include nginxproxy::authproxy
|
|
}
|
|
|
|
if ! $simple_mode {
|
|
nginxproxy::locations { 'default':
|
|
locations => $locations,
|
|
}
|
|
}
|
|
}
|
|
}
|