Forge Home

pgpool

A puppet module to configure pgpool

45,397 downloads

5,091 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.2.0 (latest)
  • 0.1.15
  • 0.1.14 (deleted)
  • 0.1.13
  • 0.1.12 (deleted)
  • 0.1.11
  • 0.1.10
  • 0.1.9
  • 0.1.8
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Sep 4th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >=2.7.0 <7.0.0
  • , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'mwhahaha-pgpool', '0.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add mwhahaha-pgpool
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install mwhahaha-pgpool --version 0.2.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

mwhahaha/pgpool — version 0.2.0 Sep 4th 2020

pgpool

Build Status

Table of Contents

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

Overview

This module can be used to manage the installation and configuration of pgpool.

Module Description

The module leverages augeas to manage the configuration file for pgpool. Additionally it allows you to manage the pool hba configuration file via the augeas pg_hba provider. You can also manage the pool_password file with the pool password resource provided by the module. The module does not manage the installation of the pgdg repository for installation of the latest version of pgpool. You can provide the package name to the pgpool module if you have built your own or would like to leverage a version that is shipped with your OS.

Setup

Setup Requirements

As part of using this module, you will need to have the following modules installed.

  • camptocamp/augeas
  • puppetlabs/stdlib
  • herculesteam/augeasproviders_core
  • herculesteam/augeasproviders_postgresql

Additionally there is a submode that references an external Augeas lense. If you want to check out this module, make sure to recursively fetch the module to get the augeas-pgpool submodule.

git clone --recursive https://github.com/mwhahaha/puppet-pgpool.git

Usage

Here is a sample configuration for a streaming replica master/slave setup and pgpool on the same node as the application.

# install the package and the service
class { 'pgpool': }

# setup our pgpool.conf
class { 'pgpool::config::connection': }
class { 'pgpool::config::healthcheck':
  health_check_period      => 5,
  health_check_timeout     => 10,
  health_check_user        => 'pgpool',
  health_check_password    => 'mypassword',
  health_check_max_retries => 1,
}
class { 'pgpool::config::loadbalance':
  load_balance_mode => 'on',
}
class { 'pgpool::config::logs':
  log_connections  => 'on',
  log_statement    => 'on',
  log_min_messages => 'info',
}
class { 'pgpool::config::masterslave':
  master_slave_mode     => 'on',
  master_slave_sub_mode => 'stream',
  sr_check_period       => 5,
  sr_check_user         => 'pgpool',
  sr_check_password     => 'mypassword',
  delay_threshold       => 1024000,
}
class { 'pgpool::config::pools':
  enable_pool_hba => 'on',
}
class { 'pgpool::config::replication':
  replication_mode => 'off',
}
class { 'pgpool::config::service':
  pid_file_name => '/var/run/pgpool-II-93/pgpool-II-93.pid',
  logdir        => '/tmp',
}
class { 'pgpool::config::ssl': }
class { 'pgpool::config::watchdog': }

# configure our backend systems
pgpool::config::backend { 'db-n01':
  id               => '0',
  hostname         => '10.0.0.4',
  port             => 5432,
  application_name => 'db-n01',
  data_directory   => '/var/lib/pgsql/9.3/data',
}
pgpool::config::backend { 'db-n02':
  id               => '1',
  hostname         => '10.0.0.5',
  port             => 5432,
  application_name => 'db-n02',
  data_directory   => '/var/lib/pgsql/9.3/data',
}

# configure our application user password access
pgpool::pool_passwd { 'my_app_user':
  password_hash => 'md5d6d70ecf643d4sec9ca6623fee1233ea',
}

# configure the pgpool hba configuration
pgpool::hba { 'my_app_user':
  type        => 'host',
  database    => 'my_db_name',
  user        => 'my_app_user',
  address     => '127.0.0.1/32',
  auth_method => 'md5',
}

Reference

Here is a list of all the available classes and resources for this module.

Classes:

  • pgpool
  • pgpool::config
  • pgpool::service
  • pgpool::package
  • pgpool::monitor
  • pgpool::config::watchdog
  • pgpool::config::pools
  • pgpool::config::loadbalance
  • pgpool::config::healthcheck
  • pgpool::config::other
  • pgpool::config::memorycache
  • pgpool::config::ssl
  • pgpool::config::logs
  • pgpool::config::replication
  • pgpool::config::masterslave
  • pgpool::config::connection
  • pgpool::config::heartbeat
  • pgpool::config::service
  • pgpool::config::failover

Resources:

  • pgpool::pool_passwd
  • pgpool::pcp
  • pgpool::hba
  • pgpool::config::backend
  • pgpool::config::val
  • pgpool::config::wdother

Limitations

This has only been tested on RedHat/CentOS 6. It might work on Debian/Ubuntu.

Development

Pull requests welcome.

Other resources

To use pgpool::monitor, the code for the pgpool-monitor package is available from pgpool-monitor.