Puppet Class: psick::php::fpm

Defined in:
manifests/php/fpm.pp

Summary

This class installs and manages php-fpm

Overview

Examples:

include psick::php::fpm

Parameters:

  • ensure (Psick::Ensure) (defaults to: 'present')
  • package_name (String) (defaults to: 'php-fpm')
  • package_params (Hash) (defaults to: {})
  • service_name (String) (defaults to: 'php-fpm')
  • service_params (Hash) (defaults to: {})
  • files_hash (Hash) (defaults to: {})
  • options_hash (Hash) (defaults to: {})
  • manage (Boolean) (defaults to: $psick::manage)
  • noop_manage (Boolean) (defaults to: $psick::noop_manage)
  • noop_value (Boolean) (defaults to: $psick::noop_value)


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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'manifests/php/fpm.pp', line 5

class psick::php::fpm (

  Psick::Ensure $ensure = 'present',

  String $package_name  = 'php-fpm',
  Hash $package_params  = {},

  String $service_name  = 'php-fpm',
  Hash $service_params  = {},

  Hash $files_hash      = {},
  Hash $options_hash    = {},

  Boolean $manage                  = $psick::manage,
  Boolean $noop_manage             = $psick::noop_manage,
  Boolean $noop_value              = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }

    # Package
    $package_defaults = {
      ensure => $ensure,
    }
    package { $package_name:
      * => $package_defaults + $package_params,
    }

    # Service
    $service_defaults = {
      ensure => psick::ensure2service($ensure,'ensure'),
      enable => psick::ensure2service($ensure,'enable'),
    }
    service { $service_name:
      * => $service_defaults + $service_params,
    }

    # Configuration files
    $file_defaults = {
      ensure  => $ensure,
      require => Package[$package_name],
      notify  => Service[$service_name],
    }
    $files_hash.each |$k,$v| {
      file { $k:
        * => $file_defaults + $v,
      }
    }
  }
}