Puppet Class: haproxy
- Inherits:
- haproxy::params
- Defined in:
- manifests/init.pp
Summary
Overview
A Puppet module, using storeconfigs, to model an haproxy configuration. Currently VERY limited - assumes Redhat/CentOS setup. Pull requests accepted!
Currently requires the puppetlabs/concat module on the Puppet Forge and
uses storeconfigs on the Puppet Server to export/collect resources
from all balancer members.
Note:
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'manifests/init.pp', line 122
class haproxy (
Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]] $package_ensure = 'present',
String $package_name = $haproxy::params::package_name,
Variant[Enum['running', 'stopped'], Boolean] $service_ensure = 'running',
Boolean $service_manage = true,
Boolean $chroot_dir_manage = true,
String $service_name = $haproxy::params::service_name,
String $service_options = $haproxy::params::service_options,
String $sysconfig_options = $haproxy::params::sysconfig_options,
Hash $global_options = $haproxy::params::global_options,
Hash $defaults_options = $haproxy::params::defaults_options,
Boolean $merge_options = $haproxy::params::merge_options,
Optional[String] $restart_command = undef,
Optional[String] $custom_fragment = undef,
Stdlib::Absolutepath $config_dir = $haproxy::params::config_dir,
Optional[Stdlib::Absolutepath] $config_file = $haproxy::params::config_file,
Boolean $manage_config_dir = $haproxy::params::manage_config_dir,
Variant[Stdlib::Absolutepath, String] $config_validate_cmd = $haproxy::params::config_validate_cmd,
# Deprecated
Optional[Boolean] $manage_service = undef,
Optional[Boolean] $enable = undef,
) inherits haproxy::params {
# NOTE: These deprecating parameters are implemented in this class,
# not in haproxy::instance. haproxy::instance is new and therefore
# there should be no legacy code that uses these deprecated
# parameters.
# To support deprecating $enable
if $enable != undef {
warning('The $enable parameter is deprecated; please use service_ensure and/or package_ensure instead')
if $enable {
$_package_ensure = 'present'
$_service_ensure = 'running'
} else {
$_package_ensure = 'absent'
$_service_ensure = 'stopped'
}
} else {
$_package_ensure = $package_ensure
$_service_ensure = $service_ensure
}
# To support deprecating $manage_service
if $manage_service != undef {
warning('The $manage_service parameter is deprecated; please use $service_manage instead')
$_service_manage = $manage_service
} else {
$_service_manage = $service_manage
}
haproxy::instance { $title:
package_ensure => $_package_ensure,
package_name => $package_name,
service_ensure => $_service_ensure,
service_manage => $_service_manage,
service_name => $service_name,
chroot_dir_manage => $chroot_dir_manage,
global_options => $global_options,
defaults_options => $defaults_options,
restart_command => $restart_command,
custom_fragment => $custom_fragment,
config_dir => $config_dir,
config_file => $config_file,
merge_options => $merge_options,
service_options => $service_options,
sysconfig_options => $sysconfig_options,
config_validate_cmd => $config_validate_cmd,
}
}
|