Puppet Class: isp3node::mariadb::setup

Defined in:
manifests/mariadb/setup.pp

Overview

Parameters:

  • root_password (String)
  • public (Boolean)
  • additional_packages (Optional[Array[String]]) (defaults to: [])


14
15
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
53
54
55
56
57
58
59
60
61
62
63
# File 'manifests/mariadb/setup.pp', line 14

class isp3node::mariadb::setup(
  String $root_password,
  Boolean $public,
  Optional[Array[String]] $additional_packages = [],
) {
  $override_options = {
    mysqld => {
      bind_address => $public ? { true => undef, false => '127.0.0.1'},
    },
  }

  class { '::mysql::server':
    root_password           => $root_password,
    create_root_user        => true,
    create_root_my_cnf      => true,
    remove_default_accounts => true,
    restart                 => true,
    service_enabled         => true,
    service_manage          => true,
    override_options        => $override_options
  }
  -> package{$additional_packages:
    ensure => latest
  }

  file{'/etc/security/limits.conf': ensure => file}
  -> file_line{'mysql-soft-limit':
    ensure => present,
    path   => '/etc/security/limits.conf',
    line   => 'mysql soft nofile 65535',
    notify => Service['mysqld'],
  }
  -> file_line{'mysql-hard-limit':
    ensure => present,
    path   => '/etc/security/limits.conf',
    line   => 'mysql hard nofile 65535',
    notify => Service['mysqld'],
  }

  file{'/etc/systemd/system/mysql.service.d': ensure => directory}
  -> file{'/etc/systemd/system/mysql.service.d/limits.conf': ensure => file}
  -> ini_setting{'mysql-service-LimitNOFILE':
    ensure  => present,
    path    => '/etc/systemd/system/mysql.service.d/limits.conf',
    section => 'Service',
    setting => 'LimitNOFILE',
    value   => 'infinity',
    notify  => Service['mysqld'],
  }
}