Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the contents of /etc/default/haproxy to be overridden #194

Merged
merged 1 commit into from
Aug 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ Main class, includes all other classes.

* `service_manage`: Specifies whether the state of the HAProxy service should be managed by Puppet. Valid options: 'true' and 'false'. Default: 'true'.

* `service_options`: Contents for the `/etc/defaults/haproxy` file on Debian. Defaults to "ENABLED=1\n" on Debian, and is ignored on other systems.

#### Define: `haproxy::balancermember`

Configures a service inside a listening or backend service configuration block in haproxy.cfg.
Expand Down Expand Up @@ -529,4 +531,4 @@ Puppet Labs modules on the Puppet Forge are open projects, and community contrib

For more information, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html)

To see who's already involved, see the [list of contributors.](https://github.com/puppetlabs/puppetlabs-haproxy/graphs/contributors)
To see who's already involved, see the [list of contributors.](https://github.com/puppetlabs/puppetlabs-haproxy/graphs/contributors)
5 changes: 5 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
# [*service_manage*]
# Chooses whether the haproxy service state should be managed by puppet at all. Defaults to true
#
# [*service_options*]
# Contents for the `/etc/defaults/haproxy` file on Debian. Defaults to "ENABLED=1\n" on Debian, and is ignored on other systems.
#
# [*global_options*]
# A hash of all the haproxy global options. If you want to specify more
# than one option (i.e. multiple timeout or stats options), pass those
Expand Down Expand Up @@ -83,6 +86,7 @@
$package_name = $haproxy::params::package_name,
$service_ensure = 'running',
$service_manage = true,
$service_options = "ENABLED=1\n",
$global_options = $haproxy::params::global_options,
$defaults_options = $haproxy::params::defaults_options,
$restart_command = undef,
Expand All @@ -101,6 +105,7 @@
}
validate_string($package_name,$package_ensure)
validate_bool($service_manage)
validate_string($service_options)

# To support deprecating $enable
if $enable != undef {
Expand Down
2 changes: 1 addition & 1 deletion manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if $haproxy::_service_manage {
if ($::osfamily == 'Debian') {
file { '/etc/default/haproxy':
content => 'ENABLED=1',
content => $haproxy::service_options,
before => Service['haproxy'],
}
}
Expand Down