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
# 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',
) {

    $log_dir = '/var/log/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  => present,
        content => template('osm/waterlines.logrotate.erb'),
    }

    cron { 'import_waterlines':
        ensure   => present,
        hour     => 9,
        minute   => 13,
        monthday => 1,
        user     => 'postgres',
        command  => "/usr/local/bin/import_waterlines >> ${log_dir}/import.log 2>&1",
    }
}