GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - saltstack-formulas/postgres-formula

BranchesTags
Open more actions menu

Latest commit

 

History

731 Commits
731 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
docs
docs
 
 
postgres
postgres
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.rstcheck.cfg
.rstcheck.cfg
 
 
.rubocop.yml
.rubocop.yml
 
 
.salt-lint
.salt-lint
 
 
.travis.yml
.travis.yml
 
 
.yamllint
.yamllint
 
 
AUTHORS.md
AUTHORS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODEOWNERS
CODEOWNERS
 
 
FORMULA
FORMULA
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
LICENSE
LICENSE
 
 
commitlint.config.js
commitlint.config.js
 
 
kitchen.vagrant.yml
kitchen.vagrant.yml
 
 
kitchen.yml
kitchen.yml
 
 
pillar.example
pillar.example
 
 
pre-commit_semantic-release.sh
pre-commit_semantic-release.sh
 
 
release-rules.js
release-rules.js
 
 
release.config.js
release.config.js
 
 

Repository files navigation

postgres-formula

Travis CI Build Status Semantic Release

A formula to install and configure PostgreSQL server.

Table of Contents

  • General notes
  • Contributing to this repo
  • Available states
    • postgres
    • postgres.client
    • postgres.manage
    • postgres.python
    • postgres.server
    • postgres.upstream
  • Removal states
    • postgres.dropped
    • postgres.server.remove
    • postgres.client.remove
    • postgres.dev.remove
  • Testing
    • kitchen converge
    • kitchen verify
    • kitchen destroy
    • kitchen test
    • kitchen login
  • Testing with Vagrant
    • Requirements
    • Setup
    • Note
    • bin/kitchen converge
    • bin/kitchen verify
    • bin/kitchen destroy
    • bin/kitchen test
    • bin/kitchen login

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
  • postgres.client
  • postgres.manage
  • postgres.python
  • postgres.server
  • postgres.upstream

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/

Running inside a container (using Packer, Docker or similar tools), when OS init process is not available to start the service and enable it on "boot", set pillar value:

postgres:
  bake_image: True

This toggles starting PostgreSQL daemon by issuing raw pg_ctl or pg_ctlcluster command.

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.

Testing with Vagrant

Windows/FreeBSD/OpenBSD testing is done with kitchen-salt.

Requirements

  • Ruby
  • Virtualbox
  • Vagrant

Setup

$ gem install bundler
$ bundle install --with=vagrant
$ bin/kitchen test [platform]

Where [platform] is the platform name defined in kitchen.vagrant.yml, e.g. windows-81-latest-py3.

Note

When testing using Vagrant you must set the environment variable KITCHEN_LOCAL_YAML to kitchen.vagrant.yml. For example:

$ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test      # Alternatively,
$ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml
$ bin/kitchen test

Then run the following commands as needed.

bin/kitchen converge

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

bin/kitchen verify

Runs the inspec tests on the actual instance.

bin/kitchen destroy

Removes the Vagrant instance.

bin/kitchen test

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

bin/kitchen login

Gives you RDP/SSH access to the instance for manual testing.

About

docs.saltstack.com/en/latest/topics/development/conventions/formulas.html

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

74 stars

Watchers

36 watching

Forks

286 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.