2015-02-23 23:40:07 +05:30
|
|
|
========
|
|
|
|
postgres
|
|
|
|
========
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
See the full `Salt Formulas installation and usage instructions
|
|
|
|
<http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_.
|
|
|
|
|
|
|
|
Available states
|
|
|
|
================
|
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:local:
|
|
|
|
|
|
|
|
``postgres``
|
|
|
|
------------
|
|
|
|
|
2016-10-04 14:38:21 +03:00
|
|
|
Installs and configures both PostgreSQL server and client with creation of
|
|
|
|
various DB objects in the cluster.
|
2015-02-23 23:40:07 +05:30
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
``postgres.client``
|
2015-02-23 23:40:07 +05:30
|
|
|
-------------------
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
Installs the PostgreSQL client binaries and libraries.
|
2016-10-04 14:38:21 +03:00
|
|
|
Allows to create such DB objects as: users, tablespaces, databases, schemas and
|
|
|
|
extensions. See ``pillar.example`` file for details.
|
2015-02-23 23:40:07 +05:30
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
``postgres.python``
|
2015-04-21 13:40:01 -07:00
|
|
|
-------------------
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
Installs the PostgreSQL adapter for Python.
|
|
|
|
|
2016-10-04 14:38:21 +03:00
|
|
|
``postgres.server``
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Installs the PostgreSQL server package and prepares the DB cluster.
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
``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:
|
|
|
|
|
2016-09-23 17:50:57 +03:00
|
|
|
* ``True`` (default): adds the upstream repository to install packages from
|
|
|
|
* ``False``: makes sure that the repository configuration is absent
|
2016-09-20 15:44:49 +03:00
|
|
|
|
|
|
|
The ``postgres:version`` Pillar controls which version of the PostgreSQL
|
|
|
|
packages should be installed from the upstream repository. Defaults to ``9.5``.
|
2015-04-21 13:40:01 -07:00
|
|
|
|
2015-02-23 23:40:07 +05:30
|
|
|
Testing
|
|
|
|
=======
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
Testing is done with the ``kitchen-salt``.
|
2015-02-23 23:40:07 +05:30
|
|
|
|
|
|
|
``kitchen converge``
|
|
|
|
--------------------
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
Runs the ``postgres`` main state.
|
2015-02-23 23:40:07 +05:30
|
|
|
|
|
|
|
``kitchen verify``
|
|
|
|
------------------
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
Runs ``serverspec`` tests on the actual instance.
|
2015-02-23 23:40:07 +05:30
|
|
|
|
|
|
|
``kitchen test``
|
|
|
|
----------------
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
Builds and runs tests from scratch.
|
2015-02-23 23:40:07 +05:30
|
|
|
|
|
|
|
``kitchen login``
|
|
|
|
-----------------
|
|
|
|
|
2016-09-20 15:44:49 +03:00
|
|
|
Gives you ssh to the vagrant machine for manual testing.
|