Puppet Class: haproxy_plugin

Inherits:
haproxy_plugin::params
Defined in:
manifests/init.pp

Overview

Parameters:

  • plugins_dir (Any) (defaults to: $haproxy_plugin::params::plugins_dir)
  • application (Any) (defaults to: true)
  • agent (Any) (defaults to: true)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'manifests/init.pp', line 1

class haproxy_plugin (
  $plugins_dir = $haproxy_plugin::params::plugins_dir,
  $application = true,
  $agent = true
) inherits haproxy_plugin::params {
  # Only haproxy boxes get the agent, but everyone gets the ddl &
  # application
  File {
    ensure => present,
    owner  => 'root',
    group  => 'root',
    mode   => '0644',
    notify => Service['mcollective'],
  }
  # Put ddl everywhere
  file { "${plugins_dir}/agent/haproxy.ddl":
    source => "puppet:///modules/${module_name}/agent/haproxy.ddl",
  }
  if $application {
    file { "${plugins_dir}/application/haproxy.rb":
      source => "puppet:///modules/${module_name}/application/haproxy.rb",
    }
  }
  if $agent {
    file { "${plugins_dir}/agent/haproxy.rb":
      source => "puppet:///modules/${module_name}/agent/haproxy.rb",
    }
  } else {
    file { "${plugins_dir}/agent/haproxy.rb":
      ensure => absent,
    }
  }
}