Puppet Class: matomo

Defined in:
modules/matomo/manifests/init.pp

Overview

Class: matomo

Matomo (formerly Piwik) is an open-source analytics platform.

matomo.org/

Matomo's installation is meant to be executed manually using its UI, to initialize the database and generate the related config file. Therefore each new deployment from scratch will require some manual work, please keep it mind.

Misc: Q: Where did the deb package come from? A: debian.piwik.org, imported to jessie-wikimedia.

Parameters:

  • database_host (Any) (defaults to: 'localhost')
  • database_password (Any) (defaults to: undef)
  • database_username (Any) (defaults to: 'piwik')
  • admin_username (Any) (defaults to: undef)
  • admin_password (Any) (defaults to: undef)
  • password_salt (Any) (defaults to: undef)
  • trusted_hosts (Any) (defaults to: [])
  • piwik_username (Any) (defaults to: 'www-data')


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/matomo/manifests/init.pp', line 16

class matomo (
    $database_host      = 'localhost',
    $database_password  = undef,
    $database_username  = 'piwik',
    $admin_username     = undef,
    $admin_password     = undef,
    $password_salt      = undef,
    $trusted_hosts      = [],
    $piwik_username     = 'www-data',
) {

    apt::package_from_component { 'matomo':
        component => 'thirdparty/matomo',
        packages  => ['matomo'],
    }

    $database_name = 'piwik'
    $database_table_prefix = 'piwik_'
    $proxy_client_headers = ['HTTP_X_FORWARDED_FOR']

    file { '/etc/matomo/config.ini.php':
        ensure  => present,
        content => template('matomo/config.ini.php.erb'),
        owner   => $piwik_username,
        group   => $piwik_username,
        mode    => '0750',
        require => Package['matomo'],
    }

    file { '/var/log/matomo':
        ensure  => 'directory',
        owner   => $piwik_username,
        group   => $piwik_username,
        mode    => '0755',
        require => Package['matomo'],
    }
}