Puppet Class: prometheus::graphite_exporter

Inherits:
prometheus
Defined in:
manifests/graphite_exporter.pp

Overview

Class: prometheus::graphite_exporter

This module manages prometheus node graphite_exporter

Parameters:

[*arch*]
Architecture (amd64 or i386)

[*bin_dir*]
Directory where binaries are located

[*download_extension*]
Extension for the release binary archive

[*download_url*]
Complete URL corresponding to the where the release binary archive can be downloaded

[*download_url_base*]
Base URL for the binary archive

[*options*]
Options added to the startup command

[*group*]
Group under which the binary is running

[*init_style*]
Service startup scripts style (e.g. rc, upstart or systemd)

[*install_method*]
Installation method: url or package (only url is supported currently)

[*manage_group*]
Whether to create a group for or rely on external code for that

[*manage_service*]
Should puppet manage the service? (default true)

[*manage_user*]
Whether to create user or rely on external code for that

[*os*]
Operating system (linux is the only one supported)

[*package_ensure*]
If package, then use this for package ensure default 'latest'

[*package_name*]
The binary package name - not available yet

[*purge_config_dir*]
Purge config files no longer generated by Puppet

[*restart_on_change*]
Should puppet restart the service on configuration change? (default true)

[*service_enable*]
Whether to enable the service from puppet (default true)

[*service_ensure*]
State ensured for the service (default 'running')

[*user*]
User which runs the service

[*version*]
The binary release version

Parameters:

  • download_extension (String)
  • download_url_base (String)
  • group (String)
  • package_ensure (String)
  • package_name (String)
  • user (String)
  • version (String)
  • purge_config_dir (Boolean)
  • restart_on_change (Boolean)
  • service_enable (Boolean)
  • service_ensure (String)
  • manage_group (Boolean)
  • manage_service (Boolean)
  • manage_user (Boolean)
  • options (String)
  • os (String) (defaults to: $prometheus::os)
  • init_style (String) (defaults to: $prometheus::init_style)
  • install_method (String) (defaults to: $prometheus::install_method)
  • download_url (Optional[String]) (defaults to: undef)
  • arch (String) (defaults to: $prometheus::real_arch)
  • bin_dir (String) (defaults to: $prometheus::bin_dir)


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'manifests/graphite_exporter.pp', line 69

class prometheus::graphite_exporter (
  String $download_extension,
  String $download_url_base,
  String $group,
  String $package_ensure,
  String $package_name,
  String $user,
  String $version,
  Boolean $purge_config_dir,
  Boolean $restart_on_change,
  Boolean $service_enable,
  String $service_ensure,
  Boolean $manage_group,
  Boolean $manage_service,
  Boolean $manage_user,
  String $options,
  String $os                     = $prometheus::os,
  String $init_style             = $prometheus::init_style,
  String $install_method         = $prometheus::install_method,
  Optional[String] $download_url = undef,
  String $arch                   = $prometheus::real_arch,
  String $bin_dir                = $prometheus::bin_dir,
) inherits prometheus {

  $real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")

  $notify_service = $restart_on_change ? {
    true    => Service['graphite_exporter'],
    default => undef,
  }

  prometheus::daemon { 'graphite_exporter':
    install_method     => $install_method,
    version            => $version,
    download_extension => $download_extension,
    os                 => $os,
    arch               => $arch,
    real_download_url  => $real_download_url,
    bin_dir            => $bin_dir,
    notify_service     => $notify_service,
    package_name       => $package_name,
    package_ensure     => $package_ensure,
    manage_user        => $manage_user,
    user               => $user,
    group              => $group,
    manage_group       => $manage_group,
    purge              => $purge_config_dir,
    options            => $options,
    init_style         => $init_style,
    service_ensure     => $service_ensure,
    service_enable     => $service_enable,
    manage_service     => $manage_service,
  }
}