Code Monkey home page Code Monkey logo

postgres-formula's Introduction

postgres-formula

Travis CI Build Status Semantic Release

A formula to install and configure PostgreSQL server.

Table of Contents

General notes

See the full SaltStack Formulas installation and usage instructions.

If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.

If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning.

See Formula Versioning Section for more details.

Contributing to this repo

Commit message formatting is significant!!

Please see How to contribute for more details.

Available states

postgres

Installs and configures both PostgreSQL server and client with creation of various DB objects in the cluster. This state applies to both Linux and MacOS.

postgres.client

Installs the PostgreSQL client binaries and libraries on Linux.

postgres.manage

Creates such DB objects as: users, tablespaces, databases, schemas and extensions. See pillar.example file for details.

postgres.python

Installs the PostgreSQL adapter for Python on Linux.

postgres.server

Installs the PostgreSQL server package on Linux, prepares the DB cluster and starts the server using packaged init script, job or unit.

Note

For PostgreSQL server before version 10 to work inside a FreeBSD Jail set sysvshm=new and sysvsem=new. DO NOT SET allow.sysvipc=1. It defeats the purpose of using Jails.

Further information: https://blog.tyk.nu/blog/freebsd-jails-and-sysv-ipc/

postgres.server.image

Installs the PostgreSQL server package on Linux, prepares the DB cluster and starts the server by issuing raw pg_ctl command. The postgres:bake_image Pillar toggles this behaviour. For example:

postgres:
  bake_image: True

If set True, then it becomes possible to fully provision PostgreSQL with all supported entities from postgres.manage state during the build ("baking") of AMI / VM / Container images (using Packer, Docker or similar tools), i.e. when OS init process is not available to start the service and enable it on "boot" of resulting appliance.

Also it allows to make Docker images with PostgreSQL using functionality being available since Salt 2016.11.0 release:

salt 'minion.with.docker' dockerng.sls_build my-postgres base=centos/systemd mods=postgres

If a lookup dictionary or Pillar has postgres:bake_image set False (this is default), it is equivalent of applying postgres.server state.

postgres.upstream

Configures the PostgreSQL Official (upstream) repository on target system if applicable.

The state relies on the postgres:use_upstream_repo Pillar value which could be set as following:

  • True (default): adds the upstream repository to install packages from
  • False: makes sure that the repository configuration is absent
  • 'postgresapp' (MacOS) uses upstream PostgresApp package repository.
  • 'homebrew' (MacOS) uses Homebrew postgres

The postgres:version Pillar controls which version of the PostgreSQL packages should be installed from the upstream Linux repository. Defaults to 9.5.

Removal states

postgres.dropped

Meta state to remove Postgres software. By default the release installed by formula is targeted only. To target multiple releases, set pillar postgres.remove.multiple_releases: True.

postgres.server.remove ^^^^^^^^^^^^^^^^^^^^^^^^

Remove server, lib, and contrib packages. The postgres.server.remove will retain data by default (no data loss) - set pillar postgres.remove.data: True to remove data and configuration directories also.

postgres.client.remove ^^^^^^^^^^^^^^^^^^^^^^^^

Remove client package.

postgres.dev.remove ^^^^^^^^^^^^^^^^^^^^^^

Remove development and python packages.

Testing

Linux testing is done with kitchen-salt.

kitchen converge

Creates the docker instance and runs the postgres main state, ready for testing.

kitchen verify

Runs the inspec tests on the actual instance.

kitchen destroy ^^^^^^^^^^^^^^^^

Removes the docker instance.

kitchen test

Runs all of the stages above in one go: i.e. destroy + converge + verify + destroy.

kitchen login

Gives you SSH access to the instance for manual testing.

postgres-formula's People

Contributors

myii avatar noelmcloughlin avatar aboe76 avatar gravyboat avatar javierbertoli avatar nmadhok avatar vutny avatar semantic-release-bot avatar puneetk avatar evasdk avatar dferramosi avatar johnkeates avatar whiteinge avatar wwentland avatar rominf avatar dynjnelson avatar iggy avatar alxwr avatar audreyfeldroy avatar blast-hardcheese avatar gilou avatar techhat avatar t0fik avatar stp-ip avatar blbradley avatar abrefort avatar renoirb avatar tgoodaire avatar madssj avatar klsmithphd avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.