Puppet Class: geoip::data::puppet

Defined in:
modules/geoip/manifests/data/puppet.pp

Overview

Class geoip::data::puppet

Installs GeoIP database files from puppetmaster.

Parameters

$source - A valid puppet source directory. $data_directory - Where the data files should live.

Parameters:

  • source (String) (defaults to: 'puppet:///volatile/GeoIP')
  • data_directory (Stdlib::Unixpath) (defaults to: '/usr/share/GeoIP')
  • fetch_ipinfo_dbs (Optional[Boolean]) (defaults to: false)
  • source_ipinfo (Optional[String]) (defaults to: 'puppet:///volatile/GeoIPInfo')
  • data_directory_ipinfo (Optional[Stdlib::Unixpath]) (defaults to: '/usr/share/GeoIPInfo')


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
# File 'modules/geoip/manifests/data/puppet.pp', line 8

class geoip::data::puppet(
  # lint:ignore:puppet_url_without_modules
  String $source = 'puppet:///volatile/GeoIP',
  # lint:endignore
  Stdlib::Unixpath $data_directory = '/usr/share/GeoIP',
  Optional[Boolean] $fetch_ipinfo_dbs = false,
  # lint:ignore:puppet_url_without_modules
  Optional[String] $source_ipinfo = 'puppet:///volatile/GeoIPInfo',
  # lint:endignore
  Optional[Stdlib::Unixpath] $data_directory_ipinfo = '/usr/share/GeoIPInfo',
){

  # recursively copy the $data_directory from $source.
  file { $data_directory:
    ensure    => directory,
    owner     => 'root',
    group     => 'root',
    mode      => '0644',
    source    => $source,
    recurse   => true,
    backup    => false,
    show_diff => false,
  }

  if $fetch_ipinfo_dbs {
      file { $data_directory_ipinfo:
        ensure    =>  directory,
        owner     => 'root',
        group     => 'root',
        mode      => '0644',
        source    => $source_ipinfo,
        recurse   => true,
        backup    => false,
        show_diff => false,
      }
  }
}