Puppet Class: swift::stats::accounts

Defined in:
modules/swift/manifests/stats/accounts.pp

Overview

Parameters:

  • swift_cluster (String)
  • accounts (Hash[String, Hash])
  • credentials (Hash[String, String])
  • ensure (Wmflib::Ensure) (defaults to: present)
  • statsd_host (Any) (defaults to: 'statsd.eqiad.wmnet')
  • statsd_port (Any) (defaults to: 8125)
  • statsd_prefix (Any) (defaults to: "swift.${swift_cluster}.stats")


1
2
3
4
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
# File 'modules/swift/manifests/stats/accounts.pp', line 1

class swift::stats::accounts(
    String $swift_cluster,
    Hash[String, Hash] $accounts,
    Hash[String, String] $credentials,
    Wmflib::Ensure $ensure = present,
    $statsd_host   = 'statsd.eqiad.wmnet',
    $statsd_port   = 8125,
    $statsd_prefix = "swift.${swift_cluster}.stats",
) {
    $required_packages = [
        Package['python-swiftclient'],
        Package['python-statsd'],
        Package['swift'],
        ]

    # report account stats to graphite
    file { '/usr/local/bin/swift-account-stats':
        ensure  => $ensure,
        owner   => 'root',
        group   => 'root',
        mode    => '0555',
        source  => "puppet:///modules/${module_name}/swift-account-stats.py",
        require => $required_packages,
    }

    # report container stats to graphite
    file { '/usr/local/bin/swift-container-stats':
        ensure  => $ensure,
        owner   => 'root',
        group   => 'root',
        mode    => '0555',
        source  => "puppet:///modules/${module_name}/swift-container-stats.py",
        require => $required_packages,
    }

    $account_names = sort(keys($accounts))
    swift::stats::stats_account { $account_names:
        ensure        => $ensure,
        accounts      => $accounts,
        statsd_prefix => $statsd_prefix,
        statsd_host   => $statsd_host,
        statsd_port   => $statsd_port,
        credentials   => $credentials,
    }
}