summaryrefslogtreecommitdiff
path: root/puppet/modules/haproxy/manifests/init.pp
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-02-23 11:42:47 +0100
committervarac <varacanero@zeromail.org>2017-03-15 19:22:50 +0100
commitcce9af1fce42c29bf062cccfc46ef356d83a6328 (patch)
treeb7f6a7de0f11e9381eb833a09f1cc1175dbce9ca /puppet/modules/haproxy/manifests/init.pp
parentbb4dd153bbf1174a95017d0046ea9e1320fd81a9 (diff)
[8144] Remove Haproxy
We used haproxy because we had multiple bigcouch nodes but now with a single couchdb node this is not needed anymore. - Resolves: #8144
Diffstat (limited to 'puppet/modules/haproxy/manifests/init.pp')
-rw-r--r--puppet/modules/haproxy/manifests/init.pp149
1 files changed, 0 insertions, 149 deletions
diff --git a/puppet/modules/haproxy/manifests/init.pp b/puppet/modules/haproxy/manifests/init.pp
deleted file mode 100644
index b91591a3..00000000
--- a/puppet/modules/haproxy/manifests/init.pp
+++ /dev/null
@@ -1,149 +0,0 @@
-# == Class: haproxy
-#
-# A Puppet module, using storeconfigs, to model an haproxy configuration.
-# Currently VERY limited - Pull requests accepted!
-#
-# === Requirement/Dependencies:
-#
-# Currently requires the ripienaar/concat module on the Puppet Forge and
-# uses storeconfigs on the Puppet Master to export/collect resources
-# from all balancer members.
-#
-# === Parameters
-#
-# [*enable*]
-# Chooses whether haproxy should be installed or ensured absent.
-# Currently ONLY accepts valid boolean true/false values.
-#
-# [*version*]
-# Allows you to specify what version of the package to install.
-# Default is simply 'present'
-#
-# [*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
-# options as an array and you will get a line for each of them in the
-# resultant haproxy.cfg file.
-#
-# [*defaults_options*]
-# A hash of all the haproxy defaults options. If you want to specify more
-# than one option (i.e. multiple timeout or stats options), pass those
-# options as an array and you will get a line for each of them in the
-# resultant haproxy.cfg file.
-#
-#
-# === Examples
-#
-# class { 'haproxy':
-# enable => true,
-# global_options => {
-# 'log' => "${::ipaddress} local0",
-# 'chroot' => '/var/lib/haproxy',
-# 'pidfile' => '/var/run/haproxy.pid',
-# 'maxconn' => '4000',
-# 'user' => 'haproxy',
-# 'group' => 'haproxy',
-# 'daemon' => '',
-# 'stats' => 'socket /var/lib/haproxy/stats'
-# },
-# defaults_options => {
-# 'log' => 'global',
-# 'stats' => 'enable',
-# 'option' => 'redispatch',
-# 'retries' => '3',
-# 'timeout' => [
-# 'http-request 10s',
-# 'queue 1m',
-# 'connect 10s',
-# 'client 1m',
-# 'server 1m',
-# 'check 10s'
-# ],
-# 'maxconn' => '8000'
-# },
-# }
-#
-class haproxy (
- $manage_service = true,
- $enable = true,
- $version = 'present',
- $global_options = $haproxy::params::global_options,
- $defaults_options = $haproxy::params::defaults_options
-) inherits haproxy::params {
- include concat::setup
-
- package { 'haproxy':
- ensure => $enable ? {
- true => $version,
- false => absent,
- },
- name => 'haproxy',
- }
-
- if $enable {
- concat { '/etc/haproxy/haproxy.cfg':
- owner => '0',
- group => '0',
- mode => '0644',
- require => Package['haproxy'],
- notify => $manage_service ? {
- true => Service['haproxy'],
- false => undef,
- },
- }
-
- # Simple Header
- concat::fragment { '00-header':
- target => '/etc/haproxy/haproxy.cfg',
- order => '01',
- content => "# This file managed by Puppet\n",
- }
-
- # Template uses $global_options, $defaults_options
- concat::fragment { 'haproxy-base':
- target => '/etc/haproxy/haproxy.cfg',
- order => '10',
- content => template('haproxy/haproxy-base.cfg.erb'),
- }
-
- if ($::osfamily == 'Debian') {
- file { '/etc/default/haproxy':
- content => 'ENABLED=1',
- require => Package['haproxy'],
- before => $manage_service ? {
- true => Service['haproxy'],
- false => undef,
- },
- }
- }
-
- file { $global_options['chroot']:
- ensure => directory,
- owner => $global_options['user'],
- group => $global_options['group'],
- mode => '0550',
- require => Package['haproxy']
- }
-
- }
-
- if $manage_service {
- service { 'haproxy':
- ensure => $enable ? {
- true => running,
- false => stopped,
- },
- enable => $enable ? {
- true => true,
- false => false,
- },
- name => 'haproxy',
- hasrestart => true,
- hasstatus => true,
- require => [
- Concat['/etc/haproxy/haproxy.cfg'],
- File[$global_options['chroot']],
- ],
- }
- }
-}