Make sure the service is enabled on "deb"-based operating systems
This commit is contained in:
@@ -130,8 +130,9 @@ postgresql-start:
|
|||||||
- unless:
|
- unless:
|
||||||
- ps -p $(head -n 1 {{ postgres.conf_dir }}/postmaster.pid) 2>/dev/null
|
- ps -p $(head -n 1 {{ postgres.conf_dir }}/postmaster.pid) 2>/dev/null
|
||||||
|
|
||||||
# Try to enable PostgreSQL in "manual" way for systemd and RedHat-based distros.
|
# Try to enable PostgreSQL in "manual" way if Salt `service` state module
|
||||||
# The packages for other OS (i.e. `*.deb`) should do it automatically by default
|
# is currently not available (e.g. during Docker or Packer build when is no init
|
||||||
|
# system running)
|
||||||
|
|
||||||
postgresql-enable:
|
postgresql-enable:
|
||||||
cmd.run:
|
cmd.run:
|
||||||
@@ -139,6 +140,8 @@ postgresql-enable:
|
|||||||
- name: systemctl enable {{ postgres.service }}
|
- name: systemctl enable {{ postgres.service }}
|
||||||
{%- elif salt['cmd.which']('chkconfig') %}
|
{%- elif salt['cmd.which']('chkconfig') %}
|
||||||
- name: chkconfig {{ postgres.service }} on
|
- name: chkconfig {{ postgres.service }} on
|
||||||
|
{%- elif salt['file.file_exists']('/usr/sbin/update-rc.d') %}
|
||||||
|
- name: update-rc.d {{ service }} defaults
|
||||||
{%- else %}
|
{%- else %}
|
||||||
# Nothing to do
|
# Nothing to do
|
||||||
- name: 'true'
|
- name: 'true'
|
||||||
|
|||||||
Reference in New Issue
Block a user