-
Notifications
You must be signed in to change notification settings - Fork 284
Use copy state instead of salt-call #256
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
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 |
---|---|---|
|
@@ -164,13 +164,12 @@ postgresql-pg_hba: | |
# Create the empty file before managing to overcome the limitation of check_cmd | ||
- onlyif: test -f {{ pg_hba_path }} || touch {{ pg_hba_path }} | ||
# Make a local backup before the file modification | ||
- check_cmd: >- | ||
salt-call --local file.copy | ||
{{ pg_hba_path }} {{ pg_hba_path ~ postgres.config_backup }} remove_existing=true | ||
{%- endif %} | ||
{%- else %} | ||
- replace: False | ||
{%- endif %} | ||
- prereq: | ||
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. I guess we must wrap this with |
||
- file: backup_pg_hba | ||
- require: | ||
- file: postgresql-config-dir | ||
- watch_in: | ||
|
@@ -192,14 +191,12 @@ postgresql-pg_ident: | |
{%- if postgres.config_backup %} | ||
# Create the empty file before managing to overcome the limitation of check_cmd | ||
- onlyif: test -f {{ pg_ident_path }} || touch {{ pg_ident_path }} | ||
# Make a local backup before the file modification | ||
- check_cmd: >- | ||
salt-call --local file.copy | ||
{{ pg_ident_path }} {{ pg_ident_path ~ postgres.config_backup }} remove_existing=true | ||
{%- endif %} | ||
{%- else %} | ||
- replace: False | ||
{%- endif %} | ||
- prereq: | ||
- file: backup_pg_ident | ||
- require: | ||
- file: postgresql-config-dir | ||
{%- if postgres.prepare_cluster.run %} | ||
|
@@ -214,6 +211,18 @@ postgresql-pg_ident: | |
- service: postgresql-running | ||
{%- endif %} | ||
|
||
backup_pg_ident: | ||
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. Like above, we need the |
||
file.copy: | ||
- name: {{ pg_ident_path ~ postgres.config_backup }} | ||
- source: {{ pg_ident_path }} | ||
- force: true | ||
|
||
backup_pg_hba: | ||
file.copy: | ||
- name: {{ pg_hba_path ~ postgres.config_backup }} | ||
- source: {{ pg_hba_path }} | ||
- force: true | ||
|
||
{%- for name, tblspace in postgres.tablespaces|dictsort() %} | ||
|
||
postgresql-tablespace-dir-{{ name }}: | ||
|
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.
This is no longer needed since we are going to remove
check_cmd
parameter. Same applies for thepg_ident
.