Created
September 14, 2012 08:29
-
-
Save mrintegrity/3720770 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition: pound::listener | |
# | |
# This class installs Pound listeners | |
# | |
# Parameters: | |
# - The $listen_ip to configure the ip that the listener will listen on | |
# - The $listen_port to configure the port that the listener will listen on | |
# - The $listen_protocol to configure the protocol that the listener accepts (currently http or https) | |
# - The $ssl_cert_path to set the location of the SSL certificate if the listen_protocol is https | |
# - The $head_require to set the required header to allow connections through to the backend | |
# - The $backend_ip to set the address of the backend server that will receive traffic | |
# - The $backend_port to set the port of the backend server that will receive traffic | |
# | |
# Actions: | |
# - Install Pound listeners | |
# | |
# Requires: | |
# - The pound class | |
# | |
# Sample Usage: | |
# pound::listener { : | |
# listen_ip => '10.10.10.10', | |
# listen_port => '80', | |
# listen_protocol => 'ListenHTTP', | |
# head_require => 'Host: .*www.example.com*', | |
# backend_ip => '10.0.100.10', | |
# backend_port => '80', | |
# } | |
# | |
define pound::listener ( | |
$template = 'pound/pound.cfg.erb', | |
$listen_ip, | |
$listen_port, | |
$listen_protocol = 'ListenHTTP', | |
$head_require, | |
$backend_ip, | |
$backend_port | |
) { | |
include pound | |
file { | |
"/etc/pound/pound.cfg" : | |
content => template('pound/pound.cfg.erb'), | |
owner => 'root', | |
group => 'root', | |
mode => '755', | |
require => Package['pound'], | |
notify => Service['pound'], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment