-
Notifications
You must be signed in to change notification settings - Fork 282
Allow port
to be configurable
#218
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
Changes from all commits
06e5944
0d9a5ba
e1a19ed
6568325
79ab1a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,23 +86,50 @@ postgresql-config-dir: | |
- require: | ||
- cmd: postgresql-cluster-prepared | ||
|
||
{%- if postgres.postgresconf %} | ||
{%- set db_port = salt['config.option']('postgres.port') %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of the suggested: {%- if salt['pillar.get']('postgres.port') %}
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome! |
||
{%- if db_port %} | ||
|
||
postgresql-conf-comment-port: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the So commenting out all and then letting the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it appears that |
||
file.comment: | ||
- name: {{ postgres.conf_dir }}/postgresql.conf | ||
- regex: ^port\s*=.+ | ||
- require: | ||
- file: postgresql-config-dir | ||
|
||
{%- endif %} | ||
|
||
{%- if postgres.postgresconf or db_port %} | ||
|
||
postgresql-conf: | ||
file.blockreplace: | ||
- name: {{ postgres.conf_dir }}/postgresql.conf | ||
- marker_start: "# Managed by SaltStack: listen_addresses: please do not edit" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Obviously can't change this marker to mention that the managed block is also for the |
||
- marker_end: "# Managed by SaltStack: end of salt managed zone --" | ||
- content: | | ||
{%- if postgres.postgresconf %} | ||
{{ postgres.postgresconf|indent(8) }} | ||
{%- endif %} | ||
{%- if db_port %} | ||
port = {{ db_port }} | ||
{%- endif %} | ||
- show_changes: True | ||
- append_if_not_found: True | ||
{#- Detect empty values (none, '') in the config_backup #} | ||
- backup: {{ postgres.config_backup|default(false, true) }} | ||
- require: | ||
- file: postgresql-config-dir | ||
{%- if db_port %} | ||
- file: postgresql-conf-comment-port | ||
{%- endif %} | ||
- watch_in: | ||
- service: postgresql-running | ||
- module: postgresql-service-restart | ||
|
||
# Restart the service where reloading is not sufficient | ||
# Currently only when changes are made to `postgresql.conf` | ||
postgresql-service-restart: | ||
module.wait: | ||
- name: service.restart | ||
- m_name: {{ postgres.service }} | ||
|
||
{%- endif %} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise an unnecessary blank line rendered, more noticeable if both
listen_addresses
andport
are given.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍