Puppet Class: mimir

Defined in:
manifests/init.pp

Overview

Class: mimir

Install, configure, manage Mimir metrics platform. For a deep dive in mimir configuration see grafana.com/docs/mimir/latest/

Parameters:

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

    Mimir version under the form X.X.X

  • manage_user (Boolean) (defaults to: false)

    Boolean to specify if module should manage mimir user

  • user_home (String) (defaults to: '/var/lib/mimir')

    Home directory for the managed user

  • user_shell (String) (defaults to: '/sbin/nologin')

    Binary to use as shell for managed user

  • user_extra_groups (Array) (defaults to: [])

    Additionnal groups the managed user should be connected to

  • config_dir (String) (defaults to: '/etc/mimir')

    Directory to store the mimir configuration

  • config_group (String) (defaults to: 'mimir')

    Group to use for configuration resources

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

    Hash containing the configuration keys to override

  • config_owner (String) (defaults to: 'mimir')

    Owner to use for configuration resources

  • custom_args (Array) (defaults to: [])

    Additional arguments to set to the mimir process

  • log_dir_path (String) (defaults to: '/var/log/mimir')

    Directory to store mimir logs if log to file is enabled

  • log_dir_mode (String) (defaults to: '0700')

    Mode of the directory used to store logs

  • log_file_path (String) (defaults to: 'mimir.log')

    Filename to store mimir logs if log to file is enabled

  • log_file_mode (String) (defaults to: '0600')

    Mode of the file used to store logs

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

    Group to use for log resources

  • log_level (String) (defaults to: 'info')

    Log level to use for process mimir

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

    Owner to use for log resources

  • log_to_file (Boolean) (defaults to: false)

    Should log be kept in journald or sent to a dedicated file

  • validate_cmd (String) (defaults to: '/usr/local/bin/mimir --modules=true')

    Command use to validate configuration

  • restart_cmd (String) (defaults to: '/bin/systemctl reload mimir')

    Command use to restart/reload process

  • restart_on_change (Boolean) (defaults to: true)

    Should the process be restarted on configuration changes

  • systemd_overrides (Hash) (defaults to: { 'Service' => { # Mimir needs to open quite a lot of socket, this value seems widely used for high traffic softwares. 'LimitNOFILE' => '1048576' } })

    List of systemd parameters to override



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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'manifests/init.pp', line 28

class mimir (
    ##
    # Installation related parameters
    ##
    String    $package_ensure    = 'present',
    Boolean   $manage_user       = false,
    String    $user_home         = '/var/lib/mimir',
    String    $user_shell        = '/sbin/nologin',
    Array     $user_extra_groups = [],

    ##
    # Configuration related parameters
    ##
    String    $config_dir        = '/etc/mimir',
    String    $config_group      = 'mimir',
    # Be careful, this hash should only contains keys overriding mimir defaults (implicit configuration).
    # Check here to find them: https://grafana.com/docs/mimir/latest/operators-guide/configure/reference-configuration-parameters/
    Hash      $config_hash       = {},
    String    $config_owner      = 'mimir',
    Array     $custom_args       = [],
    String    $log_dir_path      = '/var/log/mimir',
    String    $log_dir_mode      = '0700',
    String    $log_file_path     = 'mimir.log',
    String    $log_file_mode     = '0600',
    String    $log_group         = 'root',
    String    $log_level         = 'info',
    String    $log_owner         = 'root',
    Boolean   $log_to_file       = false,
    # Note: https://github.com/grafana/mimir/issues/2588
    String    $validate_cmd      = '/usr/local/bin/mimir --modules=true',

    ##
    # Systemd related parameters
    ##
    # Set default mimir systemd service restart command
    String    $restart_cmd       = '/bin/systemctl reload mimir',
    Boolean   $restart_on_change = true,
    Hash      $systemd_overrides = {
        'Service' => {
            # Mimir needs to open quite a lot of socket, this value seems widely used for high traffic softwares.
            'LimitNOFILE' => '1048576'
        }
    }
) {
    contain ::mimir::install
    contain ::mimir::config
    contain ::mimir::service

    Class['mimir::install'] -> Class['mimir::config'] -> Class['mimir::service']
    if $restart_on_change {
        Class['mimir::config'] ~> Class['mimir::service']
    }
}