---
classes:
  - apt
  - apt::update
  - git_asf
  - python
  - subversionclient
  - unattended_upgrades

base::basepackages:
  - apt-file
  - bash
  - ca-certificates
  - haveged
  - htop
  - iotop
  - libnet-snmp-perl
  - libsnmp-perl
  - libnss-myhostname
  - sockstat
  - software-properties-common
  - vim
  - zsh

base::purgedpackages:
  - 'collectd'
  - 'collectd-core'

apache::mod::geoip::enable: true
apache::mod::geoip::flag: 'MemoryCache'
apache::mod::geoip::db_file:
 - '/usr/share/GeoIP/GeoIP.dat'
 - '/usr/share/GeoIP/GeoIPCity.dat'

apache::mod::ssl::ssl_cipher: 'HIGH:MEDIUM:!aNULL:!MD5:!RC4'

apache::log_formats:
  combined: '<%%JSON:httpd_access%%> {
    \"time\": \"%%{HIERA}{%Y-%m-%dT%H:%M:%S%z}t\",
    \"clientip\": \"%a\",
    \"duration\": %D,
    \"status\": %>s,
    \"request\": \"%U%q\",
    \"uri\": \"%U\",
    \"remote_user\": \"%u\",
    \"query_string\": \"%q\",
    \"document\": \"%f\",
    \"bytes\": %B,
    \"request_method\": \"%m\",
    \"referer\": \"%%{HIERA}{Referer}i\",
    \"useragent\": \"%%{HIERA}{User-agent}i\",
    \"vhost\": \"%%{HIERA}{Host}i\",
    \"geo_country\": \"%%{HIERA}{GEOIP_COUNTRY_CODE}n\",
    \"geo_long\": \"%%{HIERA}{GEOIP_LONGITUDE}n\",
    \"geo_lat\": \"%%{HIERA}{GEOIP_LATITUDE}n\",
    \"geo_coords\": \"%%{HIERA}{GEOIP_LATITUDE}n,%%{HIERA}{GEOIP_LONGITUDE}n\",
    \"geo_city\": \"%%{HIERA}{GEOIP_CITY}n\",
    \"geo_combo\": \"%%{HIERA}{GEOIP_CITY}n, %%{HIERA}{GEOIP_COUNTRY_NAME}n\"
    }'
apt::sources:
  'asf_internal':
    location: 'https://packages.apache.org/asf_internal'
    release: 'trusty'
    repos: 'main'
    key:
      id: '390EF70BB1EA12B2773962950EE62FB37A00258D'
      server: 'pool.sks-keyservers.net'
    include:
      deb: true
      src: false
    notify_update: true
  'elasticsearch-1.7':
    location: 'https://packages.elasticsearch.org/elasticsearch/1.7/debian'
    release: 'stable'
    repos: 'main'
    key:
      id: '46095ACC8548582C1A2699A9D27D666CD88E42B4'
      server: 'pool.sks-keyservers.net'
    include:
      deb: true
      src: false
  'elasticsearch':
    location: 'https://packages.elastic.co/elasticsearch/2.x/debian'
    release: 'stable'
    repos: 'main'
    key:
      id: '46095ACC8548582C1A2699A9D27D666CD88E42B4'
      server: 'pool.sks-keyservers.net'
    include:
      deb: true
      src: false
    ensure: absent
  'elasticsearch-2.x':
    location: 'https://packages.elastic.co/elasticsearch/2.x/debian'
    release: 'stable'
    repos: 'main'
    key:
      id: '46095ACC8548582C1A2699A9D27D666CD88E42B4'
      server: 'pool.sks-keyservers.net'
    include:
      deb: true
      src: false
  'docker-engine':
    location: 'https://apt.dockerproject.org/repo'
    release: 'ubuntu-trusty'
    repos: 'main'
    key:
      id: '58118E89F3A912897C070ADBF76221572C52609D'
      server: 'pool.sks-keyservers.net'
    include:
      deb: true
      src: false
  'puppetlabs':
    location: 'https://apt.puppetlabs.com'
    release: 'trusty'
    repos: 'main'
    key:
      id: '6F6B15509CF8E59E6E469F327F438280EF8D349F'
      server: 'keyserver.ubuntu.com'
    include:
      deb: true
      src: false
  'puppetdeps':
    location: 'https://apt.puppetlabs.com'
    release: 'trusty'
    repos: 'dependencies'
    key:
      id: '6F6B15509CF8E59E6E469F327F438280EF8D349F'
      server: 'keyserver.ubuntu.com'
    include:
      deb: true
      src: false
  'vmware-tools':
    location: 'http://packages.vmware.com/packages/ubuntu'
    release: 'trusty'
    repos: 'main'
    key:
      id: '36E47E1CC4DCC5E8152D115CC0B5E0AB66FD4949'
      server: 'pool.sks-keyservers.net'
    include:
      deb: true
      src: false
  'nodesource-6':
    location: 'https://deb.nodesource.com/node_6.x'
    release: 'trusty'
    repos: 'main'
    key:
      id: '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280'
      server: 'pool.sks-keyservers.net'
    include:
      deb: true
      src: false

apt::force:
  'orthrus':
    release: 'main'
  require: Apt::Source['asf_internal']

unattended_upgrades::update: 1
unattended_upgrades::download: 1
unattended_upgrades::upgrade: 1
unattended_upgrades::autoclean: 7
unattended_upgrades::origins:
  - '${distro_id} ${distro_codename}-security'

logrotate::rule:
  apache2:
    name: 'apache2'
    path: '/var/log/apache2/*.log'
    ensure: 'absent'
    compress: true
    compressoptions: '-9'
    rotate: 7
    create_owner: 'root'
    create_group: 'adm'
    rotate_every: 'day'
    create_mode: '0644'
    missingok: true
    dateext: true
    delaycompress: false
    ifempty: false
    create: true
    sharedscripts: true
    postrotate:
      - 'if /etc/init.d/apache2 status > /dev/null ; then /etc/init.d/apache2 reload > /dev/null; fi;'
    prerotate:
      - 'if [ -d /etc/logrotate.d/httpd-prerotate ]; then run-parts /etc/logrotate.d/httpd-prerotate; fi;'

ntp::interfaces:
    - eth0
    - lo

python::dev: true
python::pip: true

subversionclient::packages:
  - subversion
subversionclient::svn_conf_config:       '/etc/subversion/config'
subversionclient::svn_conf_servers:      '/etc/subversion/servers'
