Skip to content

Commit 823dde7

Browse files
committed
fix(postgres.manage): only reload modules if needed (fix: #214)
We don't want the `postgres-reload-modules` state reporting any changes to the user unless there is a need to reload the modules. We should only need to reload the modules if the state that manages installing the client libraries makes any changes (ie. new packages installed). In turn, the states created by the `format_state` macro only need to ensure that any module reload occurs before those states are applied. In which case using a `require` makes more sense that using `onchanges` (which may not be guaranteed to trigger).
1 parent 7529300 commit 823dde7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

postgres/macros.jinja

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{ state }}-{{ name }}:
2727
{{ state }}.{{ ensure|default('present') }}:
2828
{{- format_kwargs(kwarg) }}
29-
- onchanges:
29+
- require:
3030
- test: postgres-reload-modules
3131

3232
{%- endmacro %}

postgres/manage.sls

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ include:
2020
postgres-reload-modules:
2121
test.succeed_with_changes:
2222
- reload_modules: True
23+
- onchanges:
24+
- pkg: postgresql-client-libs
2325
2426
# User states
2527

0 commit comments

Comments
 (0)