Commit graph

75 commits

Author SHA1 Message Date
noelmcloughlin
1e527c4b91 POSTGRESAPP on MacOS 2018-03-08 11:53:38 +00:00
Denys Havrysh
74ddea8bdb [REFACTORING] Add postgres.manage state to provision DB objects 2016-10-20 12:54:39 +03:00
Denys Havrysh
234a76f1e9 Manage PostgreSQL entities with client.sls states 2016-10-04 14:38:21 +03:00
Denys Havrysh
d5dcac95a7 RedHat: make client binaries available in $PATH 2016-09-26 18:03:11 +03:00
Toby Brain
b043047af4 Support only including postgres.client 2016-09-22 11:22:24 +10:00
Denys Havrysh
8c4dc07467 Map Pillar dicts for PostgreSQL entities to the Salt state arguments 2016-09-09 18:02:47 +03:00
Denys Havrysh
1ec55e0b96 Better ACL handling in the pg_hba.conf file 2016-09-06 14:44:35 +03:00
Denys Havrysh
c285f1006c Introduce osmajorreleasemap for RedHat release specific commands 2016-09-05 13:49:33 +03:00
Denys Havrysh
8db04833c2 Set sane defaults when use_upstream_repo and version Pillars are set 2016-09-04 15:26:46 +03:00
Denys Havrysh
7307ab8dc9 Fix SLS rendering because of pkgs_extra Jinja var isn't set by default 2016-09-02 11:14:09 +03:00
Nicole Scherfenberg
2e26b6f606 fixes formula to comply to its spec
The reworks in merge #110 broke this formulas kitchen based specs.
This MR changes a few minor things, mostly  pillar.example and other inconsistent documentations.
Also, the use of db_user for `postgres_tablespace.present` and `postgres_database.present` now fits the states options, as db_password etc can be specified as well.
2016-08-05 20:44:45 +02:00
Marco Badan
e7f82a1981 Fix typo 2016-08-02 22:50:16 +02:00
Jon Nelson
1c72c7c3a1 - for encoding, lc_type, and lc_collate, only set them on the database if
they are explicitly supplied. Otherwise use the postgres database
  defaults.
2016-07-19 10:10:07 -05:00
Jon Nelson
9b5526a680 - add 'runas', 'user', and 'owner' to all database object creation
(where appropriate)
- add missing 'requires' on database objects (schemas require databases,
  databases require users, etc....)
- alter structure of schema and extension configuration:
  now schema and extension configuration follows the other items in that
  they are expected to be *dictionaries* where the key is the name of
  the object and the value is another subdictionary of configuration.
2016-07-11 19:14:31 -05:00
Jon Nelson
0220b67a85 - re-arrange cluster initialization to a set of variables in a dictionary
which control three things:
    1. should we initialize?
    2. if so, how?
    3. what environment variables and user to use
  The approach taken is very similar to what the Apache formula uses, namely:
  a default dictionary which is over-ridden by:
     os-specific defaults,
     then os codename defaults,
     then os finger defaults,
     and finally user-specified pillar values
- this also adds support for grains['osfinger']
2016-07-11 15:29:11 -05:00
Javier Bértoli
9719e2354e Allow to specify a tablespace for a database
* Tablespaces have to be created before the databases
* Add pillar examples
* Add tests
2016-06-08 07:36:28 -03:00
Gilles Dartiguelongue
e0ed6b6e77 Kill create_cluster pillar switch, refs: #100
It is just a variant of init_db. A more correct solution would be to
support configuring a different initdb command while passing values from
the pillar by default like version. This would make it truly generic but
is probably not achievable given current pillar self-referencing
capabilities (ie. none).

Thus, I decided to make it OS family specific since Debian provides its
own tools to manage clusters, etc. Gentoo also has a specific way to
initialize a new cluster which does not fit with commands.initdb so
the current if/elif would be extended when support is added for Gentoo.
2016-06-07 12:00:50 +02:00
Gilles Dartiguelongue
4a00acf26a Split postgresql-cluster-prepared in two states, refs: #100
Previous write up lead the two pillar settings overwriting each other in the same state.
We can now properly select whether to create a cluster and/or initialize a new database.

Also the commands will not fail if both settings are false as found on Debian family OSes
as this is taken care of by the packaging system for main cluster.
2016-06-06 14:37:51 +02:00
Alex Powell
dca04c76d1 Adding pkg dependency for directory permissions. 2016-06-05 12:55:00 +01:00
Niels Abspoel
efba14c7a2 Merge pull request #93 from tgoodaire/master
Allow initdb to be run as other users, cleanup of dependencies
2016-05-25 21:57:35 +02:00
Tim Goodaire
3ee730996b Cleanup, including restructuring and renaming 2016-05-25 12:12:48 -04:00
Dennis Ahrens
52f27d2df7 Reload postgresql server instead of restarting it
In case of changes in postgresql.conf and pg_hba.conf the
postgresql will now reload instead of restart.
2016-05-25 11:12:53 +02:00
Tim Goodaire
fac8b6b936 Rename runtime_dir to data_dir 2016-05-24 11:40:14 -04:00
Tim Goodaire
e4bb5bf133 Improvements to initdb stuff 2016-05-24 11:02:30 -04:00
Tim Goodaire
8a4eb569f4 - Added initdb_user configuration, renamed postgres_user and postgres_group to user and group
- Corrected inadvertent changes to postgres_user
- Fixed postgres_user
- Explicitly list the grain that we're filtering by even though it's
  default
- Place *BSD user and runas into osmap instead of hardcoding
2016-05-23 15:02:26 -04:00
Tim Goodaire
e36478bcd6 Convert hard-coded postgres user and group to variables, enforce ownership of conf dir, don't create pg_hba.conf unless initdb has succeeded 2016-05-20 12:12:40 -05:00
Campbell
11f4f0f580 Added option to disable creation of backup file when postgresql.conf changes 2016-03-14 19:19:32 +00:00
Brandon Bradley
dea3c52880 do not manage permissions of postgres config directory 2016-01-15 09:04:31 -06:00
puneet kandhari
471ac94a5b Remove backwards incompatible change 2015-11-23 11:42:26 -06:00
puneet kandhari
7bfde30dde Merge pull request #74 from tenso-m/extra
replace pkg_contrib with pkgs_extra
2015-11-23 06:54:22 -06:00
Roman Inflianskas
d11ba6d14a replace pkg_contrib with pkgs_extra 2015-11-23 14:50:46 +03:00
Roman Inflianskas
38e5962600 ensure proper permissions for postgresql dir 2015-11-23 14:50:42 +03:00
Roman Inflianskas
2204733990 support options in extensions 2015-11-17 18:14:17 +03:00
Roman Inflianskas
8edafaf7a4 support schemas 2015-11-17 18:14:17 +03:00
Devon Stewart
40b3729341 Making initdb command overridable 2015-11-06 00:02:00 -08:00
Devon Stewart
ec8d37e0e6 Require postgresql service when trying to create databases 2015-11-06 00:01:43 -08:00
Devon Stewart
4030891045 Fixing broken references 2015-11-05 23:49:16 -08:00
Roland Baum
a83f9da115 added option to remove users 2015-10-06 13:24:53 +02:00
Nitin Madhok
9455349a8b Merge pull request #57 from webplatform/master
Added superuser pillar, missing conf_dir directory
2015-08-09 08:01:12 -04:00
Edvinas Klovas
d7580104f6 Add support for database extensions.
This commit adds support for database extensions via
salt.states.postgres_extension

When configuring database pillar data all you need to do is add (optional)
extension list with the extensions that you want the state to apply to specific
database. Example:

    db1:
      owner: 'localUser'
      user: 'localUser'
      template: 'template0'
      lc_ctype: 'C.UTF-8'
      lc_collate: 'C.UTF-8'
      extensions:
        - uuid-ossp

This will make sure `uuid-ossp` extension is enabled on `db1` database.

Updated pillar.example to include (optional) extensions
2015-07-23 17:54:24 +03:00
Forrest
b33f9f06a8 Merge pull request #55 from dferrantelli/dev_state
moved dev packages to seperate state
2015-05-05 16:21:33 -07:00
Dominic Ferrantelli
1b97d540ca moved dev packages to seperate state 2015-05-05 15:40:49 -07:00
Dominic Ferrantelli
9e1ff20af5 added other postgres user perms such that they can be enbabled/disabled by this formula 2015-05-05 11:52:33 -07:00
Renoir Boulanger
5d807cc47a postgres_user.present didnt have superuser option 2015-04-29 21:05:16 -04:00
Renoir Boulanger
de48c74c88 Ensure pg_hba.conf parent directory exists 2015-04-29 18:45:22 -04:00
Brian Jackson
17baaa9f8c Add _states/_modules for tablespaces and add tablespace support to formula
Add temporary states/modules for handling tablespaces in Postgresql. These will
be fed back upstream, but they can live here for now.

Add support for the states/modules to the formula.
2015-04-23 11:17:39 -05:00
Brian Jackson
967fa6504b Switch to new style map.jinja
Move this formula to the new style map.jinja. Still need to sort out RedHat
handling, but it's not any worse than it was before (i.e. horribly broken)
2015-04-22 17:47:02 -05:00
Dominic Ferrantelli
7ddfbb22e6 moved upstream repo to an include, checked for Ubuntu before attempting to add it 2015-04-21 15:13:42 -07:00
Dominic Ferrantelli
430c735b0d added automatic indentation of postgres:postgresconf to allow for multiple lines to be added to the conf 2015-03-12 16:14:34 -07:00
Rico Moorman
9a21a59b58 Adjust the init state's jinja syntax to prevent errors if there is no postgres pillar data 2015-02-27 00:29:51 +01:00