Puppet Class: shinken::shinkengen

Defined in:
modules/shinken/manifests/shinkengen.pp

Overview

Class: shinken::shinkengen

Sets up shinkengen python package to generate hosts & services config for Shinken by hittig the wikitech API

Parameters:

  • site (Any)
  • keystone_api_fqdn (Any)
  • keystone_port (Any)
  • puppet_enc_host (Any)


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
# File 'modules/shinken/manifests/shinkengen.pp', line 5

class shinken::shinkengen(
    $site,
    $keystone_api_fqdn,
    $keystone_port,
    $puppet_enc_host,
) {
    include shinken

    require_package('python-requests',
                    'python-yaml')

    file { '/etc/shinkengen.yaml':
        content => template('shinken/shinkengen.yaml.erb'),
        owner   => 'shinken',
        group   => 'shinken',
    }

    file { '/usr/local/bin/shinkengen':
        source  => 'puppet:///modules/shinken/shinkengen.py',
        owner   => 'shinken',
        group   => 'shinken',
        mode    => '0555',
        require => Package['python-yaml'],
    }

    exec { '/usr/local/bin/shinkengen':
        user    => 'shinken',
        group   => 'shinken',
        unless  => '/usr/local/bin/shinkengen --test-if-up-to-date',
        require => [
            File['/usr/local/bin/shinkengen'],
            File['/etc/shinkengen.yaml'],
            Package['shinken'],
        ],
        notify  => Service['shinken'],
    }
}