Puppet Class: openstack::puppet::master::instance_info_dumper

Defined in:
modules/openstack/manifests/puppet/master/instance_info_dumper.pp

Overview

Sets up a small python script that dumps all info about instances into a JSON file periodically

Parameters:

  • puppetmaster (Any)


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
# File 'modules/openstack/manifests/puppet/master/instance_info_dumper.pp', line 4

class openstack::puppet::master::instance_info_dumper(
    $puppetmaster,
    ) {

    require_package('python-requests')

    file { '/usr/local/sbin/instance-info-dumper':
        ensure => 'present',
        source => 'puppet:///modules/openstack/puppet/master/instance-info-dumper.py',
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
    }

    $config = {
        'enc_host'    => $puppetmaster,
        'output_path' => '/srv/instance-info.yaml',
    }

    file { '/etc/instance-dumper.yaml':
        ensure  => 'present',
        content => ordered_yaml($config),
        mode    => '0400',
        owner   => 'root',
        group   => 'root',
    }

    cron { 'dump-instances':
        ensure  => 'absent',
        user    => 'root',
        minute  => '*/15',
        command => '/usr/local/sbin/instance-info-dumper',
    }
}