6 Commits

Author SHA1 Message Date
semantic-release-bot
cb8de937a5 chore(release): 0.37.3 [skip ci]
## [0.37.3](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.2...v0.37.3) (2019-05-16)

### Bug Fixes

* **freebsd-user:** fix FreeBSD daemon's user for PostgreSQL >= 9.6 ([8745365](https://github.com/saltstack-formulas/postgres-formula/commit/8745365)), closes [#263](https://github.com/saltstack-formulas/postgres-formula/issues/263)
2019-05-16 08:05:28 +00:00
Denys Havrysh
5763d220e5 Merge pull request #268 from Strade28/master
fix(freebsd-user): fix FreeBSD daemon's user for PostgreSQL >= 9.6
2019-05-16 10:45:15 +03:00
julien levieil
8745365d71 fix(freebsd-user): fix FreeBSD daemon's user for PostgreSQL >= 9.6
For postgresql 9.6 and newer, the default unix user used by postgresql
daemon has changed to 'postgres', and the default data directory is:
/var/db/postgres/data96

Closes #263
2019-05-16 09:35:35 +11:00
semantic-release-bot
10126fb740 chore(release): 0.37.2 [skip ci]
## [0.37.2](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.1...v0.37.2) (2019-05-12)

### Bug Fixes

* **sysrc-svc:** workaround *BSD minion indefinitely hanging on start ([0aa8b4a](https://github.com/saltstack-formulas/postgres-formula/commit/0aa8b4a))
2019-05-12 22:44:15 +00:00
Imran Iqbal
65519cb06f Merge pull request #264 from sticky-note/master
fix(sysrc-svc): workaround *BSD minion indefinitely hanging on start
2019-05-12 23:24:58 +01:00
sam
0aa8b4a048 fix(sysrc-svc): workaround *BSD minion indefinitely hanging on start
Check https://github.com/saltstack/salt/issues/44848 for further details
2019-05-13 08:44:52 +11:00
11 changed files with 87 additions and 22 deletions

View File

@@ -7,7 +7,7 @@ Avatar|Contributor|Contributions
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|57 <img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|57
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>|[@aboe76](https://github.com/aboe76)|47 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>|[@aboe76](https://github.com/aboe76)|47
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>|[@gravyboat](https://github.com/gravyboat)|41 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>|[@gravyboat](https://github.com/gravyboat)|41
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>|[@myii](https://github.com/myii)|40 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>|[@myii](https://github.com/myii)|41
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>|[@vutny](https://github.com/vutny)|30 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>|[@vutny](https://github.com/vutny)|30
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>|[@nmadhok](https://github.com/nmadhok)|19 <img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>|[@nmadhok](https://github.com/nmadhok)|19
<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>|[@javierbertoli](https://github.com/javierbertoli)|18 <img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>|[@javierbertoli](https://github.com/javierbertoli)|18
@@ -69,4 +69,4 @@ Avatar|Contributor|Contributions
--- ---
Auto generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-05-06. Auto generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-05-16.

View File

@@ -1,5 +1,19 @@
# Changelog # Changelog
## [0.37.3](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.2...v0.37.3) (2019-05-16)
### Bug Fixes
* **freebsd-user:** fix FreeBSD daemon's user for PostgreSQL >= 9.6 ([8745365](https://github.com/saltstack-formulas/postgres-formula/commit/8745365)), closes [#263](https://github.com/saltstack-formulas/postgres-formula/issues/263)
## [0.37.2](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.1...v0.37.2) (2019-05-12)
### Bug Fixes
* **sysrc-svc:** workaround *BSD minion indefinitely hanging on start ([0aa8b4a](https://github.com/saltstack-formulas/postgres-formula/commit/0aa8b4a))
## [0.37.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1) (2019-05-06) ## [0.37.1](https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1) (2019-05-06)

View File

@@ -1,7 +1,7 @@
name: postgres name: postgres
os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
version: 0.37.1 version: 0.37.3
release: 1 release: 1
minimum_version: 2016.11 minimum_version: 2016.11
summary: Postgres formula summary: Postgres formula

View File

@@ -24,7 +24,7 @@ This list is sorted by the number of commits per contributor in *descending* ord
- 41 - 41
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars2.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>`
- `@myii <https://github.com/myii>`_ - `@myii <https://github.com/myii>`_
- 40 - 41
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>` * - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>`
- `@vutny <https://github.com/vutny>`_ - `@vutny <https://github.com/vutny>`_
- 30 - 30
@@ -203,4 +203,4 @@ This list is sorted by the number of commits per contributor in *descending* ord
---- ----
Auto generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-05-06. Auto generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-05-16.

View File

@@ -2,6 +2,24 @@
Changelog Changelog
========= =========
`0.37.3 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.2...v0.37.3>`_ (2019-05-16)
-------------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **freebsd-user:** fix FreeBSD daemon's user for PostgreSQL >= 9.6 (\ `8745365 <https://github.com/saltstack-formulas/postgres-formula/commit/8745365>`_\ ), closes `#263 <https://github.com/saltstack-formulas/postgres-formula/issues/263>`_
`0.37.2 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.1...v0.37.2>`_ (2019-05-12)
-------------------------------------------------------------------------------------------------------------
Bug Fixes
^^^^^^^^^
* **sysrc-svc:** workaround *BSD minion indefinitely hanging on start (\ `0aa8b4a <https://github.com/saltstack-formulas/postgres-formula/commit/0aa8b4a>`_\ )
`0.37.1 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1>`_ (2019-05-06) `0.37.1 <https://github.com/saltstack-formulas/postgres-formula/compare/v0.37.0...v0.37.1>`_ (2019-05-06)
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------

View File

@@ -24,7 +24,10 @@ postgres:
# These pillars are typically never required. # These pillars are typically never required.
# pkg: 'postgresql' # pkg: 'postgresql'
# pkg_client: 'postgresql-client' # pkg_client: 'postgresql-client'
# service: postgresql # service:
# name: 'postgresql'
# flags: -w -s -m fast
# sysrc: True
pkgs_extra: pkgs_extra:
- postgresql-contrib - postgresql-contrib
- postgresql-plpython - postgresql-plpython

View File

@@ -67,7 +67,9 @@ postgres:
config_backup: '.bak' config_backup: '.bak'
service: postgresql service:
name: postgresql
sysrc: False
bake_image: False bake_image: False

View File

@@ -21,20 +21,33 @@ Debian:
{% endif %} {% endif %}
FreeBSD: FreeBSD:
conf_dir: /usr/local/pgsql/data {% if repo.version|float >= 9.6 %}
data_dir: /usr/local/pgsql/data user: &freebsd-user postgres
group: &freebsd-group postgres
conf_dir: {{ '/var/db/postgres/data' ~ release }}
data_dir: {{ '/var/db/postgres/data' ~ release }}
{% else %}
user: &freebsd-user pgsql user: &freebsd-user pgsql
group: &freebsd-group pgsql group: &freebsd-group pgsql
conf_dir: /usr/local/pgsql/data
data_dir: /usr/local/pgsql/data
{% endif %}
pkg_client: postgresql{{ release }}-client pkg_client: postgresql{{ release }}-client
pkg: postgresql{{ release }}-server pkg: postgresql{{ release }}-server
prepare_cluster: prepare_cluster:
user: *freebsd-user user: *freebsd-user
group: *freebsd-group group: *freebsd-group
service:
flags: -w -s -m fast
sysrc: True
OpenBSD: OpenBSD:
conf_dir: /var/postgresql/data conf_dir: /var/postgresql/data
data_dir: /var/postgresql/data data_dir: /var/postgresql/data
user: _postgresql user: _postgresql
service:
flags: -w -s -m fast
sysrc: True
RedHat: RedHat:
pkg_repo: pkg_repo:
@@ -54,7 +67,8 @@ RedHat:
pkg_dev: postgresql{{ release }}-devel pkg_dev: postgresql{{ release }}-devel
conf_dir: {{ data_dir }} conf_dir: {{ data_dir }}
data_dir: {{ data_dir }} data_dir: {{ data_dir }}
service: postgresql-{{ repo.version }} service:
name: postgresql-{{ repo.version }}
# Alternatives system # Alternatives system
linux: linux:
@@ -132,7 +146,8 @@ Suse:
pkg_libs: postgresql{{ release }}-libs pkg_libs: postgresql{{ release }}-libs
conf_dir: {{ data_dir }} conf_dir: {{ data_dir }}
data_dir: {{ data_dir }} data_dir: {{ data_dir }}
service: postgresql-{{ repo.version }} service:
name: postgresql-{{ repo.version }}
# Alternatives system # Alternatives system
linux: linux:
@@ -175,9 +190,11 @@ Suse:
## jinja check avoids rendering noise/failure on Linux ## jinja check avoids rendering noise/failure on Linux
MacOS: MacOS:
{%- if repo.use_upstream_repo == 'homebrew' %} {%- if repo.use_upstream_repo == 'homebrew' %}
service: homebrew.mxcl.postgresql service:
name: homebrew.mxcl.postgresql
{%- elif repo.use_upstream_repo == 'postgresapp' %} {%- elif repo.use_upstream_repo == 'postgresapp' %}
service: com.postgresapp.Postgres2 service:
name: com.postgresapp.Postgres2
{%- endif %} {%- endif %}
pkg: postgresql pkg: postgresql
pkg_client: pkg_client:

View File

@@ -24,11 +24,11 @@ postgresql-start:
postgresql-enable: postgresql-enable:
cmd.run: cmd.run:
{%- if salt['file.file_exists']('/bin/systemctl') %} {%- if salt['file.file_exists']('/bin/systemctl') %}
- name: systemctl enable {{ postgres.service }} - name: systemctl enable {{ postgres.service.name }}
{%- elif salt['cmd.which']('chkconfig') %} {%- elif salt['cmd.which']('chkconfig') %}
- name: chkconfig {{ postgres.service }} on - name: chkconfig {{ postgres.service.name }} on
{%- elif salt['file.file_exists']('/usr/sbin/update-rc.d') %} {%- elif salt['file.file_exists']('/usr/sbin/update-rc.d') %}
- name: update-rc.d {{ service }} defaults - name: update-rc.d {{ postgres.service.name }} defaults
{%- else %} {%- else %}
# Nothing to do # Nothing to do
- name: 'true' - name: 'true'

View File

@@ -31,8 +31,8 @@ postgresql-server:
- require_in: - require_in:
- file: postgresql-server - file: postgresql-server
file.managed: file.managed:
- name: /Library/LaunchAgents/{{ postgres.service }}.plist - name: /Library/LaunchAgents/{{ postgres.service.name }}.plist
- source: /usr/local/opt/postgres/{{ postgres.service }}.plist - source: /usr/local/opt/postgres/{{ postgres.service.name }}.plist
- group: wheel - group: wheel
- require_in: - require_in:
- service: postgresql-running - service: postgresql-running
@@ -261,12 +261,23 @@ postgresql-tablespace-dir-{{ name }}-fcontext:
{%- if not postgres.bake_image %} {%- if not postgres.bake_image %}
# Workaround for FreeBSD minion undefinitely hanging on service start
# cf. https://github.com/saltstack/salt/issues/44848
{% if postgres.service.sysrc %}
posgresql-rc-flags:
sysrc.managed:
- name: {{ postgres.service.name }}_flags
- value: "{{ postgres.service.flags }} > /dev/null 2>&1"
- watch_in:
- service: postgresql-running
{% endif %}
# Start PostgreSQL server using OS init # Start PostgreSQL server using OS init
# Note: This is also the target for numerous `watch_in` requisites above, used # Note: This is also the target for numerous `watch_in` requisites above, used
# for the necessary service restart after changing the relevant configuration files # for the necessary service restart after changing the relevant configuration files
postgresql-running: postgresql-running:
service.running: service.running:
- name: {{ postgres.service }} - name: {{ postgres.service.name }}
- enable: True - enable: True
# Reload the service for changes made to `pg_ident.conf`, except for `MacOS` # Reload the service for changes made to `pg_ident.conf`, except for `MacOS`
@@ -275,7 +286,7 @@ postgresql-running:
postgresql-service-reload: postgresql-service-reload:
module.wait: module.wait:
- name: service.reload - name: service.reload
- m_name: {{ postgres.service }} - m_name: {{ postgres.service.name }}
- require: - require:
- service: postgresql-running - service: postgresql-running
{%- endif %} {%- endif %}

View File

@@ -2,7 +2,7 @@
postgresql-dead: postgresql-dead:
service.dead: service.dead:
- name: {{ postgres.service }} - name: {{ postgres.service.name }}
- enable: False - enable: False
postgresql-repo-removed: postgresql-repo-removed: