Puppet Class: profile::cescout

Defined in:
modules/profile/manifests/cescout.pp

Overview

Parameters:

  • metadb_dir (Stdlib::Unixpath) (defaults to: lookup(profile::cescout::postgres::metadb_dir))
  • postgres_version (String) (defaults to: lookup(profile::cescout::postgres::version))
  • http_proxy (String) (defaults to: lookup('http_proxy'))


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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'modules/profile/manifests/cescout.pp', line 1

class profile::cescout (
    Stdlib::Unixpath $metadb_dir       = lookup(profile::cescout::postgres::metadb_dir),
    String           $postgres_version = lookup(profile::cescout::postgres::version),
    String           $http_proxy       = lookup('http_proxy'),
) {

    require_package('cescout')

    # required by metadb_s3_tarx
    require_package('make', 'bc')

    # for the specific version of postgres required, 9.6
    apt::package_from_component { 'thirdparty-postgres96':
        component => 'thirdparty/postgres96',
        packages  => ['postgresql-9.6']
    }

    # enable system-wide proxy for cescout
    file { '/etc/profile.d/cescout.sh':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('cescout/cescout.sh.erb'),
    }

    # directory for saving metadb data. the OONI scripts use (and expect)
    # /mnt/metadb as they mount an EBS volume on EC2; since we don't do that,
    # we can use any directory and later point the metadb_s3_tarx to it.
    file { $metadb_dir:
        ensure => 'directory',
        owner  => 'postgres',
        group  => 'postgres',
        mode   => '0700',
    }

    # copy the metadb_s3_tarx file, the script that sets up the metadb sync.
    file { '/usr/local/sbin/metadb_s3_tarx':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0544',
        content => template('cescout/metadb_s3_tarx.erb'),
    }

    # copy the metadb-configure.sh file, that calls metadb_s3_tarx and the
    # other scripts to finalize the sync process
    file { '/usr/local/sbin/metadb-configure':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0544',
        content => template('cescout/metadb-configure.sh.erb'),
    }

    systemd::tmpfile { 'postgresql':
        content => 'd /var/run/postgresql 0755 postgres postgres',
    }

    systemd::service { "postgresql@${postgres_version}-main.service":
        ensure   => present,
        override => true,
        restart  => true,
        content  => template('cescout/postgres-systemd-override.conf.erb'),
        require  => Package['postgresql-9.6'],
    }

}