• Stars
    star
    115
  • Rank 304,154 (Top 7 %)
  • Language
    Python
  • Created over 9 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Ansible role for managing a PostgreSQL server

PostgreSQL

An Ansible role for installing and managing PostgreSQL servers. This role works with both Debian and RedHat based systems, and provides backup scripts for PostgreSQL Continuous Archiving and Point-in-Time Recovery. It does not create or manage PostgreSQL users, roles, groups, databases, and so forth. For that, see galaxyproject.postgresql_objects.

On RedHat-based platforms, the PostgreSQL Global Development Group (PGDG) packages packages will be installed. On Debian-based platforms, you can choose from the distribution's packages (from APT) or the PGDG packages.

Changes that require a restart will not be applied unless you manually restart PostgreSQL. This role will reload the server for those configuration changes that can be updated with only a reload because reloading is a non-intrusive operation, but options that require a full restart will not cause the server to restart.

Requirements

This role requires Ansible 2.4+

Role Variables

All variables are optional

  • postgresql_user_name: System username to be used for PostgreSQL (default: postgres).

  • postgresql_version: PostgreSQL version to install. On Debian-based platforms, the default is whatever version is pointed to by the postgresql metapackage). On RedHat-based platforms, the default is 10.

  • postgresql_flavor: On Debian-based platforms, this specifies whether you want to use PostgreSQL packages from pgdg or the distribution's apt repositories. Possible values: apt, pgdg (default: apt).

  • postgresql_conf: A list of hashes (dictionaries) of postgresql.conf options (keys) and values. These options are not added to postgresql.conf directly - the role adds a conf.d subdirectory in the configuration directory and an include statement for that directory to postgresql.conf. Options set in postgresql_conf are then set in conf.d/25ansible_postgresql.conf. For legacy reasons, this can also be a single hash, but the list syntax is preferred because it preserves order.

    Due to YAML parsing, you must take care when defining values in postgresql_conf to ensure they are properly written to the config file. For example:

    postgresql_conf:
      - max_connections: 250
      - archive_mode: "off"
      - work_mem: "'8MB'"

    Becomes the following in 25ansible_postgresql.conf:

    max_connections = 250
    archive_mode = off
    work_mem: '8MB'
    
  • postgresql_pg_hba_conf: A list of lines to add to pg_hba.conf

  • postgresql_pg_hba_local_postgres_user: If set to false, this will remove the postgres user's entry from pg_hba.conf that is preconfigured on Debian-based PostgreSQL installations. You probably do not want to do this unless you know what you're doing.

  • postgresql_pg_hba_local_socket: If set to false, this will remove the local entry from pg_hba.conf that is preconfigured by the PostgreSQL package.

  • postgresql_pg_hba_local_ipv4: If set to false, this will remove the host ... 127.0.0.1/32 entry from pg_hba.conf that is preconfigured by the PostgreSQL package.

  • postgresql_pg_hba_local_ipv6: If set to false, this will remove the host ... ::1/128 entry from pg_hba.conf that is preconfigured by the PostgreSQL package.

  • postgresql_pgdata: Only set this if you have changed the $PGDATA directory from the package default. Note this does not configure PostgreSQL to actually use a different directory, you will need to do that yourself, it just allows the role to properly locate the directory.

  • postgresql_conf_dir: As with postgresql_pgdata except for the configuration directory.

  • postgresql_install_psycopg2: Attempt to install the correct pacakge providing psycopg2 to the Python interpreter that Ansible is using on the remote side. This allows for the use of the postgresql_* Ansible modules (perhaps via galaxyproject.postgresql_objects), which depend on psycopg2. Defaults to true.

Backups

  • postgresql_backup_dir: If set, enables PITR backups. Set this to a directory where your database will be backed up (this can be any format supported by rsync, e.g. user@host:/path). The most recent backup will be in a subdirectory named current.

  • postgresql_backup_local_dir: Filesystem path on the PostgreSQL server where backup scripts will be placed.

  • postgresql_backup_[hour|minute]: Controls what time the cron job will run to perform a full backup. Defaults to 1:00 AM.

  • postgresql_backup_[day|month|weekday]: Additional cron controls for when the full backup is performed (default: *).

  • postgresql_backup_post_command: Arbitrary command to run after successful completion of a scheduled backup.

Additional options pertaining to backups can be found in the defaults file.

Dependencies

Backup functionality requires Python 2.7 or 3.5+, psycopg2, and rsync. Note that if installing PGDG versions of PostgreSQL on Enterprise Linux, corresponding psycopg2 packages are available from the PGDG yum repositories.

Example Playbook

Standard install: Default postgresql.conf, pg_hba.conf and default version for the OS:

---

- hosts: dbservers
  remote_user: root
  roles:
    - postgresql

Use the pgdg packages on a Debian-based host:

---

- hosts: dbservers
  remote_user: root
  vars:
    postgresql_flavor: pgdg
  roles:
    - postgresql

Use the PostgreSQL 9.5 packages and set some postgresql.conf options and pg_hba.conf entries:

---

- hosts: dbservers
  remote_user: root
  vars:
    postgresql_version: 9.5
    postgresql_conf:
      - listen_addresses: "''"    # disable network listening (listen on unix socket only)
      - max_connections: 50       # decrease connection limit
    postgresql_pg_hba_conf:
      - host all all 10.0.0.0/8 md5
  roles:
    - postgresql

Enable backups to /archive

- hosts: all
  remote_user: root
  vars:
    postgresql_backup_dir: /archive
  roles:
    - postgresql

License

Academic Free License ("AFL") v. 3.0

Author Information

The Galaxy Community and contributors

More Repositories

1

galaxy

Data intensive science for everyone.
Python
1,342
star
2

training-material

A collection of Galaxy-related training material
HTML
305
star
3

tools-iuc

Tool Shed repositories maintained by the Intergalactic Utilities Commission
HTML
161
star
4

SARS-CoV-2

Ongoing analysis of COVID-19 using Galaxy, BioConda and public research infrastructures
Jupyter Notebook
128
star
5

galaxy-hub

Galaxy Community Hub
HTML
99
star
6

planemo

Command-line utilities to assist in developing Galaxy and Common Workflow Language artifacts - including tools, workflows, and training materials.
Python
85
star
7

bioblend

A Python library for interacting with the Galaxy API
Python
83
star
8

ansible-slurm

Ansible role for installing and managing the Slurm Workload Manager
Jinja
72
star
9

admin-training

Galaxy Admin Training
HCL
60
star
10

ansible-galaxy

An Ansible role for managing a Galaxy server
Jinja
57
star
11

cloudlaunch

Easily launch cloud applications.
Python
42
star
12

galaxy-helm

Minimal setup required to run Galaxy under Kubernetes
Python
41
star
13

pulsar

Distributed job execution application built for Galaxy
Python
38
star
14

tools-devteam

Contains a set of Galaxy Tools mostly written by the Galaxy Team.
Python
37
star
15

cloudman

Easily create and manage compute clusters on any Cloud.
Python
37
star
16

usegalaxy-playbook

Ansible Playbook for usegalaxy.org
Shell
31
star
17

iwc

Galaxy Workflows maintained by the Intergalactic Workflow Commission
Python
28
star
18

ephemeris

Library for managing Galaxy plugins - tools, index data, and workflows.
Python
27
star
19

gxadmin

Handy command line utility for Galaxy administrators πŸš€
Shell
23
star
20

galaxy-language-server

Galaxy Language Server to help in Galaxy (https://galaxyproject.org/) tool wrappers development.
Python
22
star
21

ansible-common-roles

A collection of simple Ansible roles for common (mostly system) tasks
Python
20
star
22

galaxy-cloudman-playbook

Build components for CloudMan, Galaxy on the Cloud, or Galaxy Server
20
star
23

blend4j

blend4j is a JVM partial reimplementation of the Python library bioblend for interacting with Galaxy, CloudMan, and BioCloudCentral.
Java
16
star
24

ansible-galaxy-tools

An Ansible role for automated installation of tools from a Tool Shed into Galaxy.
Python
14
star
25

gravity

Galaxy process management and system administration tools
Python
13
star
26

total-perspective-vortex

Total Perspective Vortex provides an installable set of dynamic rules for the Galaxy application that can route entities (Tools, Users, Roles) to appropriate job destinations based on a configurable yaml file.
Python
13
star
27

cargo-port

cache packages permanently
Python
12
star
28

galaxy-lib

Subset of Galaxy (http://galaxyproject.org/) core code designed to be used as a library.
Python
12
star
29

galaxy-beta1

Galaxy Github repository BETA 1. May be destroyed and recreated if post-conversion problems are found (but post-conversion commits on this repo will be reapplied to any recreations). Scary disclaimer aside, so far so good! Full details:
Python
12
star
30

awesome-galaxy

Awesome resources related to Galaxy project
11
star
31

infrastructure-playbook

Ansible playbook for managing Galaxy infrastructure. For the playbook managing Galaxy itself, see https://github.com/galaxyproject/usegalaxy-playbook/
Jinja
11
star
32

usegalaxy-tools

usegalaxy.* common tools
Shell
11
star
33

ansible-postgresql-objects

A simple Ansible role for managing PostgreSQL objects (users, groups, databases, and privileges).
Jinja
11
star
34

ansible-galaxy-extras

Ansible roles to configure assorted compontents for an Ubuntu VM or container configured with https://github.com/galaxyproject/ansible-galaxy with production services including nginx, uwsgi, supervisor, protftp, and slurm.
HTML
11
star
35

ansible-cvmfs

An Ansible role for installing and configuring CernVM-FS (CVMFS)
C
10
star
36

planemo-machine

A packer.io configuration for building out Galaxy (http://galaxyproject.org/) tool development environments.
HTML
10
star
37

idc

Simon's Data Club - Reference data for Galaxy servers
Shell
9
star
38

galaxy-docker-k8s

An Ansible playbook for building a Galaxy container for Kubernetes.
HTML
9
star
39

planemo-monitor

Planemo scripting to monitor repositories and register tool containers.
Shell
9
star
40

gxformat2

Galaxy Workflow Format 2
HTML
9
star
41

ansible-cloudman-image

An Ansible role for building a machine image for CloudMan.
Python
8
star
42

cloudlaunch-ui

A user interface for the cloudlaunch app
TypeScript
8
star
43

starforge

Build Galaxy dependencies, wheels, and other things, in Docker (and other things)
Python
8
star
44

Galaxy-XSD

Galaxy XML tool wrapper XSD
Shell
8
star
45

small-scale-galaxy-admins

8
star
46

ansible-nginx

An Ansible role for managing an nginx server.
Jinja
7
star
47

tiaas2

Reusable Training Infrastructure as a Service
Python
7
star
48

galaxy_codex

Galaxy Communities Dock aka Galaxy Codex: catalog of Galaxy resources (tools, training, workflows)
Python
7
star
49

galaxy-flavor-testing

Travis scripts to unify and ease the testing of Galaxy favors
Makefile
6
star
50

galaxy-upload

Galaxy Upload Utility for the CLI
Python
6
star
51

planemo-ci-action

Test, deploy, or lint changed Galaxy tools or workflows using Planemo.
Shell
6
star
52

blend4php

A PHP API for interacting with Galaxy
PHP
6
star
53

galaxy-tours

Collection of Galaxy-tours
6
star
54

ansible-galaxy-toolshed

An Ansible role for managing a Galaxy (http://galaxyproject.org) Tool Shed server. For a role to install Galaxy itself, see https://github.com/galaxyproject/ansible-galaxy
HTML
6
star
55

sequence_utils

Galaxy's sequence utilities are a set of Python modules for reading, analyzing, and converting sequence formats.
Python
5
star
56

usage-metering

Scripts and queries for inspecting Galaxy usage data.
Jupyter Notebook
5
star
57

ansible-pulsar

An Ansible role for managing a Pulsar (https://github.com/galaxyproject/pulsar) server.
Jinja
5
star
58

galaxy-tool-repository-template

5
star
59

seek-bzip2

C
5
star
60

ansible-proftpd

Ansible role for installing and configuring ProFTPD for Galaxy
Jinja
5
star
61

wheelforge

Build Python wheels from recipes using cibuildwheel
Python
4
star
62

edam_data

A Python-packaged version of EDAM Ontology Data (http://edamontology.org/)
Python
4
star
63

ansible-interactive-environments

An Ansible role for installing Galaxy Interactive Environments
HTML
4
star
64

ptdk

Webserver for Planemo Training Development Kit
Python
4
star
65

docker-galaxy-requirements

Galaxy requirements for installing Tools from the Tool Shed
Dockerfile
4
star
66

galaxy-maps

3
star
67

dockstore-galaxy-interface

Dockstore Plugin for Galaxy Workflows
Java
3
star
68

cloudauthz

Python
3
star
69

gx-it-proxy

JavaScript
3
star
70

gx-tool-db

An application for managing structured metadata about Galaxy tools.
Python
3
star
71

ansible-miniconda

An Ansible role for managing a Miniconda installation.
3
star
72

ansible-galaxy-os

An Ansible role is for configuring the base operating system useful for running Galaxy.
3
star
73

tpv-shared-database

A shared database of rules for Total Perspective Vortex used by the usegalaxy.* federation.
3
star
74

gxabm

Scripts for automating tasks in Galaxy
Python
2
star
75

starforge-recipes

Build recipes for Galaxy Starforge
Shell
2
star
76

ansible-mailman3

Ansible role for installing and managing the GNU Mailman 3 suite
Jinja
2
star
77

pulsar-helm

Helm charts for Pulsar
Smarty
2
star
78

p4

Proper Prior Planning Prevents Poorly Performed PRs...Probably
Python
2
star
79

conda-iuc

Conda recipes maintained by the Galaxy IUC.
Shell
2
star
80

ansible-opendkim

Ansible role for installing, configuring, and managing OpenDKIM
HTML
2
star
81

jxtx

JavaScript
2
star
82

homebrew-toolshed

Homebrew tap for Tool Shed packages. (Experimental and work in progress).
Ruby
2
star
83

ansible-cloudman-database

An Ansible role for setting up PostgreSQL database for use with Galaxy CloudMan.
2
star
84

hack-the-galaxy-gcc2017

2
star
85

ansible-tiaas2

Ansible role for deploying TIaaS2
HTML
2
star
86

cloudlaunch-registry

An application registry for CloudLaunch
2
star
87

galaxyproject.github.io

Informational repository, highlighting the code offerings of Galaxyproject
HTML
2
star
88

ansible-cloudman-galaxy-setup

This role is used to setup Galaxy for use with CloudMan.
HTML
2
star
89

gxyarchiver

Python
2
star
90

ansible-trackster

An Ansible role for setting up Galaxy Trackster.
2
star
91

galaxy_mentor_network

Galaxy Mentor Network
SCSS
2
star
92

homebrew-tap

A Homebrew (http://brew.sh/) tap for Galaxy (http://galaxyproject.org/) related software.
Ruby
2
star
93

gxy.io

The gxy.io link shortening service
Shell
2
star
94

TIS_methods_review

Jupyter Notebook
1
star
95

galaxy-test-data

Test data files used by Galaxy.
HTML
1
star
96

gsoc

1
star
97

galaxy-merger

Script that automates merging Galaxy.
Shell
1
star
98

galaxytutorial-ismb17

1
star
99

gx-tool-db-project

A project containing database created with the gx-tool-db tool.
Shell
1
star
100

alignment-pipeline

1
star