Puppet Class: minio::server::config

Defined in:
manifests/server/config.pp

Summary

Applies configuration for `::minio::server` class to system.

Overview

Copyright


Copyright 2017-2021 Daniel S. Reichenbach <kogitoapp.com>

Examples:

class { 'minio::server::config':
    owner                          => 'minio',
    group                          => 'minio',
    configuration_directory        => '/etc/minio',
    installation_directory         => '/opt/minio',
    storage_root                   => '/var/minio',
    configuration                  => {
        'MINIO_ROOT_USER'     => 'admin',
        'MINIO_ROOT_PASSWORD' => 'password',
        'MINIO_REGION_NAME'   => 'us-east-1',
    },
    custom_configuration_file_path => '/etc/default/minio',
}

Parameters:

  • owner (String) (defaults to: $minio::server::owner)

    The user owning minio and its’ files.

  • group (String) (defaults to: $minio::server::group)

    The group owning minio and its’ files.

  • configuration_directory (Stdlib::Absolutepath) (defaults to: $minio::server::configuration_directory)

    Directory holding Minio configuration file./minio`

  • installation_directory (Stdlib::Absolutepath) (defaults to: $minio::server::installation_directory)

    Target directory to hold the minio installation./minio`

  • storage_root (Variant[Stdlib::Absolutepath, Array[Stdlib::Absolutepath]]) (defaults to: $minio::server::storage_root)

    Directory or directories where minio will keep all data.

  • configuration (Hash[String[1], Variant[String, Integer]]) (defaults to: $minio::server::configuration)

    Hash with environment settings for Minio.

  • custom_configuration_file_path (Optional[Stdlib::Absolutepath]) (defaults to: $minio::server::custom_configuration_file_path)

    Optional custom location of the minio environment file.

Author:

  • Daniel S. Reichenbach <daniel@kogitoapp.com>

  • Evgeny Soynov <esoynov@kogito.network>



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
# File 'manifests/server/config.pp', line 42

class minio::server::config (
  Hash[String[1], Variant[String, Integer]] $configuration = $minio::server::configuration,
  String $owner = $minio::server::owner,
  String $group = $minio::server::group,
  Stdlib::Absolutepath $configuration_directory = $minio::server::configuration_directory,
  Stdlib::Absolutepath $installation_directory = $minio::server::installation_directory,
  Variant[Stdlib::Absolutepath, Array[Stdlib::Absolutepath]] $storage_root = $minio::server::storage_root,
  Optional[Stdlib::Absolutepath] $custom_configuration_file_path = $minio::server::custom_configuration_file_path,
  ) {

  $storage = [$storage_root].flatten()
  if ($storage.length() > 1 and !has_key($configuration, 'MINIO_DEPLOYMENT_DEFINITION')) {
    fail('Please provide a value for the MINIO_DEPLOYMENT_DEFINITION in configuration to run distributed or erasure-coded deployment.')
  }

  $configuration_file_path = pick($custom_configuration_file_path, "${configuration_directory}/config")

  $default_configuration = {
    'MINIO_ROOT_USER'             => 'admin',
    'MINIO_ROOT_PASSWORD'         => 'password',
    'MINIO_REGION_NAME'           => 'us-east-1',
    'MINIO_DEPLOYMENT_DEFINITION' => $storage[0],
  }

  $resulting_configuration = deep_merge($default_configuration, $configuration)

  file { $configuration_file_path:
    content => template('minio/config.erb'),
    owner   => $owner,
    group   => $group,
    mode    => '0644',
  }
}