Puppet Class: datadog_agent::integrations::php_fpm

Inherits:
datadog_agent::params
Defined in:
manifests/integrations/php_fpm.pp

Overview

Parameters:

  • status_url (Any) (defaults to: 'http://localhost/status')
  • ping_url (Any) (defaults to: 'http://localhost/ping')
  • ping_reply (Any) (defaults to: 'pong')
  • http_host (Any) (defaults to: undef)
  • tags (Any) (defaults to: [])
  • instances (Any) (defaults to: undef)
  • use_fastcgi (Any) (defaults to: 'false')


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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'manifests/integrations/php_fpm.pp', line 29

class datadog_agent::integrations::php_fpm(
  $status_url       = 'http://localhost/status',
  $ping_url         = 'http://localhost/ping',
  $ping_reply       = 'pong',
  $http_host        = undef,
  $tags             = [],
  $instances        = undef,
  $use_fastcgi      = 'false'
) inherits datadog_agent::params {
  require ::datadog_agent

  if !$instances {
    $_instances = [{
      'http_host' => $http_host,
      'status_url' => $status_url,
      'ping_url' => $ping_url,
      'ping_reply' => $ping_reply,
      'tags' => $tags,
      'use_fastcgi' => $use_fastcgi,
    }]
  } else {
    $_instances = $instances
  }

  $legacy_dst = "${datadog_agent::params::legacy_conf_dir}/php_fpm.yaml"
  if $::datadog_agent::_agent_major_version > 5 {
    $dst_dir = "${datadog_agent::params::conf_dir}/php_fpm.d"
    file { $legacy_dst:
      ensure => 'absent'
    }

    file { $dst_dir:
      ensure  => directory,
      owner   => $datadog_agent::params::dd_user,
      group   => $datadog_agent::params::dd_group,
      mode    => $datadog_agent::params::permissions_directory,
      require => Package[$datadog_agent::params::package_name],
      notify  => Service[$datadog_agent::params::service_name]
    }
    $dst = "${dst_dir}/conf.yaml"
  } else {
    $dst = $legacy_dst
  }

  file { $dst:
    ensure  => file,
    owner   => $datadog_agent::params::dd_user,
    group   => $datadog_agent::params::dd_group,
    mode    => $datadog_agent::params::permissions_protected_file,
    content => template('datadog_agent/agent-conf.d/php_fpm.yaml.erb'),
    require => Package[$datadog_agent::params::package_name],
    notify  => Service[$datadog_agent::params::service_name]
  }
}