Puppet Class: proxysql

Defined in:
manifests/init.pp

Summary

Install, configures, and manages ProxySQL

Overview

Examples:

class { '::proxysql':
  datadir         => '/var/lib/proxysql',
  datadir_mode    => '0750',
  logdir          => '/var/log/proxysql',
  logdir_mode     => '0750',
  configs         => {
    admin_variables => {
      admin_credentials => 'admin:admin;remoteadmin:remateadminpass',
      mysql_ifaces      => '0.0.0.0:6032',
    },
    mysql_variables => {
      threads                   => 8,
      max_connections           => 4096,
      interfaces                => '0.0.0.0:3306',
      stacksize                 => 1048576,
      ping_interval_server_msec => 10000,
    },
    mysql_servers => [
      {
        address   => mysql,
        port      => 3306,
        hostgroup => 0,
      },
    ],
    mysql_users => [
      {
        username => root,
      },
    ],
    mysql_query_rules => [
      {
        rule_id       => 1,
        active        => 1,
        match_pattern => '.',
        log           => 1,
        apply         => 0,
      },
    ],
  },
}

Parameters:

  • owner (String)

    The user to run proxysql.

  • group (String)

    Which group should belong to proyxsql.

  • package_ensure (String)

    What state the package should be in.

  • datadir (Stdlib::Absolutepath)

    The path to the data directory.

  • datadir_mode (Stdlib::Filemode)

    The desired permissions mode for the file, in symbolic or numeric notation.

  • logdir (Stdlib::Absolutepath)

    The path to the log directory.

  • logdir_mode (Stdlib::Filemode)

    The desired permissions mode for the file, in symbolic or numeric notation.

  • configfile (Stdlib::Absolutepath)

    The path to the default configuration.

  • configfile_mode (Stdlib::Filemode)

    The desired permissions mode for the file, in symbolic or numeric notation.

  • configfile_show_diff (Boolean)

    Whether to display differences when the file changes, defaulting to false.

  • service_ensure (Stdlib::Ensure::Service)

    Whether a service should be running.

  • service_enable (Boolean)

    Whether a service should be enabled to start at boot.

  • configs (Hash)

    A hash of parameters for configuring proxysql.cnf. See also github.com/sysown/proxysql/wiki/Configuring-ProxySQL

  • refresh_from_config (Boolean)

See Also:



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'manifests/init.pp', line 75

class proxysql (
  String                  $owner,
  String                  $group,
  String                  $package_ensure,
  Stdlib::Absolutepath    $datadir,
  Stdlib::Filemode        $datadir_mode,
  Stdlib::Absolutepath    $logdir,
  Stdlib::Filemode        $logdir_mode,
  Stdlib::Absolutepath    $configfile,
  Stdlib::Filemode        $configfile_mode,
  Boolean                 $configfile_show_diff,
  Stdlib::Ensure::Service $service_ensure,
  Boolean                 $service_enable,
  Hash                    $configs,
  Boolean                 $refresh_from_config,
) {

  include proxysql::repo
  include proxysql::install
  include proxysql::config
  include proxysql::service

  Class['::proxysql::repo']
  -> Class['::proxysql::install']
  -> Class['::proxysql::config']

  if $refresh_from_config {
    Class['::proxysql::config'] ~> Class['::proxysql::service']
  } else {
    Class['::proxysql::config'] -> Class['::proxysql::service']
  }

}