Puppet Class: geoip

Defined in:
manifests/init.pp

Overview

The geoip module installs tools and databases GeoIP resolution from MaxMind.

You may replace userid and licensekey with your subscription and add the productids you want to sync. Leaving these options on default will allow you to sync all free available databases. With database_directory the destination directory of the databases can be set, protocol, proxy* and *_verification may only be needed in the case your host needs some specific proxy settings to get to the internet.

Examples:

hiera

geoip::config:
  userid: '999999'
  licensekey: '000000000000'
  productids:
    - GeoLite2-City
    - GeoLite2-Country
  database_directory:
  protocol:
  proxy:
  proxy_user_password:
  skip_hostname_verification:
  skip_peer_verification:

Parameters:

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

    install or remove settings done by this module

  • packages (Array[String]) (defaults to: ['mmdb-bin', 'geoipupdate'])

    the software packages containing the tools to be installed

  • package_ensure (String) (defaults to: 'latest')

    which version of the packages should be ensured

  • config_path (Stdlib::Absolutepath) (defaults to: '/etc/GeoIP.conf')

    path to the configuration and license file

  • config_version (Enum['lt311','ge311']) (defaults to: 'lt311')

    the config version to use for geoipupdate

  • config (Hash) (defaults to: {})

    hash of configuration options

  • manage_service (Boolean) (defaults to: true)

    whether to manage database updating service

  • systemd_config (Enum['unit', 'dropin']) (defaults to: 'unit')

    type of configuration how changes are applied to systemd

  • service_user (String) (defaults to: 'root')

    effective user the update service should run

  • service_group (String) (defaults to: 'root')

    effective group the update service should run

  • update_path (Stdlib::Absolutepath) (defaults to: '/usr/bin/geoipupdate')

    path to the geoipupdate tool, used by update service

  • service_name (String) (defaults to: 'geoip_update')

    name of the update service

  • update_timers (Array[String]) (defaults to: [])

    wallclock timers when the update service should be triggered (for syntax see systemd.time(7)#Parsing Timestamps)

  • update_scatter (Integer) (defaults to: 1800)

    a time window in seconds of randomized, host specific delay of the update trigger (see systemd.timer(5)#AccuracySec)



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'manifests/init.pp', line 40

class geoip (
  Enum['present', 'absent'] $ensure = 'present',
  Array[String]             $packages = ['mmdb-bin', 'geoipupdate'],
  String                    $package_ensure = 'latest',
  Stdlib::Absolutepath      $config_path = '/etc/GeoIP.conf',
  Enum['lt311','ge311']     $config_version = 'lt311',
  Hash                      $config = {},
  Boolean                   $manage_service = true,
  Enum['unit', 'dropin']    $systemd_config = 'unit',
  String                    $service_user = 'root',
  String                    $service_group = 'root',
  Stdlib::Absolutepath      $update_path = '/usr/bin/geoipupdate',
  String                    $service_name = 'geoip_update',
  Array[String]             $update_timers = [],
  Integer                   $update_scatter = 1800,
) {
  contain geoip::install
  contain geoip::config
  contain geoip::service

  Class['geoip::install']
  -> Class['geoip::config']
  ~> Class['geoip::service']
}