Puppet Class: datadog_agent::integrations::memcache
- Inherits:
- datadog_agent::params
- Defined in:
- manifests/integrations/memcache.pp
Overview
Class: datadog_agent::integrations::memcache
This class will install the necessary configuration for the memcache integration
Parameters:
$url:
url used to connect to the memcached instance
$port:
$tags
Optional array of tags
Sample Usage:
include ‘datadog_agent::integrations::memcache’
OR
class { ‘datadog_agent::integrations::memcache’:
url => 'localhost',
}
Sample Usage (Instance):
class { 'datadog_agent::integrations::memcache' :
instances => [{
url => 'localhost',
port => '11211',
items => false,
slabs => false,
}]
}
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 83 84 85 86 |
# File 'manifests/integrations/memcache.pp', line 33
class datadog_agent::integrations::memcache (
String $url = 'localhost',
Variant[String, Integer] $port = 11211,
Array $tags = [],
Variant[Boolean, String] $items = false,
Variant[Boolean, String] $slabs = false,
Optional[Array] $instances = undef,
) inherits datadog_agent::params {
require ::datadog_agent
if !$instances and $url {
$_instances = [{
'url' => $url,
'port' => $port,
'tags' => $tags,
'items' => $items,
'slabs' => $slabs,
}]
} elsif !$instances{
$_instances = []
} else {
$_instances = $instances
}
$legacy_dst = "${datadog_agent::params::legacy_conf_dir}/mcache.yaml"
if $::datadog_agent::_agent_major_version > 5 {
$dst_dir = "${datadog_agent::params::conf_dir}/mcache.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/mcache.yaml.erb'),
require => Package[$datadog_agent::params::package_name],
notify => Service[$datadog_agent::params::service_name]
}
}
|