[WIP][discuss][bug]psql needs to be installed manually before running formula bacause it's used wrong for table detection (causes formula to fail completely) #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[fix]
A bug fixDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
Splitt off from #148 so the rest of the changes can be merged separately
Describe the changes you're proposing
Ignore changes done in #148 and discuss them there please
zabbix/pgsql/schema.sls should be changed to NOT use salt.postgresql.psql_schema on COMPILE time in jinja. This causes it to fail in case the psql is not present on the host yet -> even though zabbix.pgsql.pkgs looks like it should install it, it will not pass that far, so it will never pass without manual intervention.
Also we don't need to use dbroot_user and dbroot_password for that, we're using dbuser and dbpassword for import, so we should have enough permissions to check if the tables exist, so in my proposal, schema doesn't use these variables at all (they are only needed for zabbix.pgsql.conf, which uses them to create DB/user).
Pillar / config required to test the proposed changes
Use pgsql, eg.
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context
@hatifnatt didn;t like the approach with added shell to run the psql (even though the import state does the same).
I tried to find a way, but i have no idea how to do it in a nicer way.
most promising idea was this, but i have no idea how to nicely process the output to make it plain True/False and the test state can't take anything more complex.