Skip to content

Fix conf_dir => data_dir required for preparing cluster #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions postgres/server/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ postgresql-{{ bin }}-altinstall:

postgresql-cluster-prepared:
file.directory:
- name: {{ postgres.conf_dir }}
- name: {{ postgres.data_dir }}
Copy link
Contributor

@noelmcloughlin noelmcloughlin Jun 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for inadvertent mistake on my part.

I had correctly specified data_dir in this branch but wrong value got merged.

- user: {{ postgres.user }}
- group: {{ postgres.group }}
- makedirs: True
Expand All @@ -81,10 +81,12 @@ postgresql-cluster-prepared:
{%- endif %}
- cwd: /
- env: {{ postgres.prepare_cluster.env }}
- runas: {{ postgres.user }}
- runas: {{ postgres.prepare_cluster.user }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the previous value was postgres.prepare_cluster.user so we should revert.

- require:
- pkg: postgresql-server
- file: postgresql-cluster-prepared
- watch_in:
- module: postgresql-service-restart

postgresql-config-dir:
file.directory:
Expand Down Expand Up @@ -140,15 +142,15 @@ postgresql-conf:
- watch_in:
- module: postgresql-service-restart

{%- endif %}

# Restart the service where reloading is not sufficient
# Currently only when changes are made to `postgresql.conf`
# Currently when the cluster is created or changes made to `postgresql.conf`
postgresql-service-restart:
module.wait:
- name: service.restart
- m_name: {{ postgres.service }}

{%- endif %}

{%- set pg_hba_path = salt['file.join'](postgres.conf_dir, 'pg_hba.conf') %}

postgresql-pg_hba:
Expand Down