Puppet Class: newrelic::params

Overview

Class: newrelic::params

This class handles parameters for the newrelic module

Actions:

None

Authors:

Felipe Salum <fsalum@gmail.com> Craig Watson <craig.watson@claranet.uk>

Copyright 2012 Felipe Salum Copyright 2017 Claranet



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
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/params.pp', line 19

class newrelic::params {

  case $facts['os']['family'] {
    'RedHat': {
      $manage_repo         = true
      $server_package_name = 'newrelic-sysmond'
      $server_service_name = 'newrelic-sysmond'
      $php_package_name    = 'newrelic-php5'
      $php_service_name    = 'newrelic-daemon'
      $php_conf_dir        = '/etc/php.d'
      $php_extra_packages  = ['php-cli']
      $run_installer       = true

      if $facts['os']['release']['major'] == '7' {
        # Abstract socket
        # - https://discuss.newrelic.com/t/apm-not-showing-data-php-5-6-centos-7-apache-httpd-2-4/30756/5
        $php_default_ini_settings = {
          'daemon.port' => '"@newrelic-daemon"'
        }
        $php_default_daemon_settings = {
          'port' => '"@newrelic-daemon"'
        }
      } else {
        $php_default_ini_settings = {}
        $php_default_daemon_settings = {}
      }
    }

    'Debian': {
      $manage_repo                 = true
      $server_package_name         = 'newrelic-sysmond'
      $server_service_name         = 'newrelic-sysmond'
      $php_package_name            = 'newrelic-php5'
      $php_service_name            = 'newrelic-daemon'
      $php_default_ini_settings    = {}
      $php_default_daemon_settings = {}
      $php_extra_packages          = []
      $run_installer               = false

      case $facts['os']['distro']['codename'] {
        'xenial','stretch': { $php_conf_dir = '/etc/php/7.0/mods-available' }
        default:            { $php_conf_dir = '/etc/php5/mods-available' }
      }
    }

    'Windows': {
      $manage_repo             = false
      $bitness                 = regsubst($facts['os']['architecture'],'^x([\d]{2})','\1')
      $server_package_name     = 'New Relic Server Monitor'
      $server_service_name     = 'nrsvrmon'
      $temp_dir                = 'C:/Windows/temp'
      $server_monitor_source   = 'http://download.newrelic.com/windows_server_monitor/release/'
      $dotnet_conf_dir         = 'C:\\ProgramData\\New Relic\\.NET Agent'
      $dotnet_package          = "New Relic .NET Agent (${bitness}-bit)"
      $dotnet_source           = 'http://download.newrelic.com/dot_net_agent/release/'
      $dotnet_application_name = 'My Application'
    }

    default: {
      fail("Unsupported osfamily: ${facts[osfamily]} operatingsystem: ${facts[operatingsystem]}")
    }
  }

}