Forge Home

proxysql

Install, configures, and manages ProxySQL

9,127 downloads

5,557 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.6.0 (latest)
  • 0.5.0
  • 0.4.0
  • 0.3.2
  • 0.3.1
  • 0.3.0
  • 0.2.1
  • 0.2.0
  • 0.1.0
released Nov 11th 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 6.0.0
  • , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'hfm-proxysql', '0.6.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add hfm-proxysql
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install hfm-proxysql --version 0.6.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

hfm/proxysql — version 0.6.0 Nov 11th 2018

puppet-proxysql Build Status Puppet Forge

Table of Contents

  1. Description
  2. Setup - The basics of getting started with proxysql
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

The proxysql module handles installing, configuring, and running ProxySQL.

Setup

Setup Requirements

The proxysql module requires the following puppet module:

note: puppetlabs-apt is soft dependencies. If you are installing on Debian systems, you will need to configure appropriate versions of this module.

Beginning with proxysql

To set up the proxysql with default parameters, declare the proxysql class like the following:

include ::proxysql

Usage

Configuring modules in Puppet

To set up the proxysql in Puppet codes, you can configure like the following:

class { '::proxysql':
  datadir      => '/var/lib/proxysql',
  datadir_mode => '0750',
  logdir       => '/var/log/proxysql',
  logdir_mode  => '0750'.
}

Configuring modules from Hiera

To set up ProxySQL using Hiera, you declare include ::proxysql in puppet manifests and configure in Hiera like the following:

---
proxysql::datadir: '/var/lib/proxysql'
proxysql::datadir_mode: '0750'
proxysql::logdir: '/var/log/proxysql'
proxysql::logdir_mode: '0750'
proxysql::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

Reference

Public Class: proxysql

parameters

Parameter Data type Description Default
owner String The user to run proxysql. 'proxysql'
group String Which group should belong to proyxsql. 'proxysql'
package_ensure String What state the package should be in. 'installed'
datadir Stdlib::Absolutepath Path to data directory. '/var/lib/proxysql'
datadir_mode Stdlib::Filemode The permissions for the data directory. '0700'
logdir Stdlib::Absolutepath Path to log directory. '/var/log/proxysql'
logdir_mode Stdlib::Filemode The permissions for the log directory. '0700'
configfile Stdlib::Absolutepath Path to configuration file. '/etc/proxysql.cnf'
configfile_mode Stdlib::Filemode The permissions for the config file. '0600'
configfile_show_diff Boolean Whether to display differences when the file changes false
service_ensure Stdlib::Ensure::Service Whether proxysql should be running. 'running'
service_enable Boolean Whether proxysql should be enabled to start at boot. true
configs Hash The Configuration hashes for proxysql.cnf See data/common.yaml
refresh_from_config Boolean Whether proxysql should be restarted after updating configuration. false

Private Classes

  • proxysql::repo
  • proxysql::install
  • proxysql::config
  • proxysql::service

Limitations

See operatingsystem_support in metadata.json

Development

Running tests

The proxysql puppet module contains tests for both rspec-puppet (unit tests) and beaker-rspec (acceptance tests) to verify functionality. For detailed information on using these tools, please see their respective documentation.

Testing quickstart

  • Unit tests:
$ bundle install
$ bundle exec rake
  • Acceptance tests:
# Set your DOCKER_HOST variable
$ eval "$(docker-machine env default)"

# List available beaker nodesets
$ bundle exec rake beaker_nodes
centos7
debian9

# Run beaker acceptance tests
$ BEAKER_set=debian9 bundle exec rake beaker