Puppet Class: osm::import_waterlines

Defined in:
modules/osm/manifests/import_waterlines.pp

Overview

Definition: osm::import_waterlines

Sets up waterlines Parameters:

* database - postgres database name
* use_proxy - when set to true, proxy is used
* proxy - web proxy used for downloading shapefiles

Parameters:

  • use_proxy (Boolean)
  • proxy_host (String)
  • proxy_port (Stdlib::Port)
  • database (String) (defaults to: 'gis')


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
# File 'modules/osm/manifests/import_waterlines.pp', line 8

class osm::import_waterlines (
    Boolean $use_proxy,
    String $proxy_host,
    Stdlib::Port $proxy_port,
    String $database = 'gis',
) {

    $logfile_basedir = '/var/log'
    $log_dir = "${logfile_basedir}/waterlines"

    $proxy_opt = $use_proxy ? {
        false   => '',
        default => "-x ${proxy_host}:${proxy_port}",
    }

    file { '/usr/local/bin/import_waterlines':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0555',
        content => template('osm/import_waterlines.erb'),
    }

    file { $log_dir:
        ensure => directory,
        owner  => 'postgres',
        group  => 'postgres',
        mode   => '0755',
    }

    logrotate::conf { 'import_waterline':
        ensure  => absent,
    }

    systemd::timer::job { 'waterlines':
        ensure          => present,
        description     => 'Regular jobs to set up the waterlines',
        user            => 'postgres',
        command         => '/usr/local/bin/import_waterlines',
        logfile_basedir => $logfile_basedir,
        logfile_name    => 'import.log',
        interval        => {'start' => 'OnCalendar', 'interval' => '*-*-01 9:13:00'},
    }

}