Open
Conversation
hexylena
reviewed
Jun 14, 2022
Comment on lines
39
to
+47
| - name: Get installed version | ||
| command: dpkg-query -f ${Version;3} --show postgresql | ||
| shell: "dpkg-query -f '${Version;3}' --show postgresql" | ||
| when: postgresql_version is not defined | ||
| register: __postgresql_version_query_result | ||
| changed_when: false | ||
| check_mode: no | ||
| args: | ||
| # Using this in order to enforce the task to be executed in check mode | ||
| removes: "{{ __temp_file_for_check_mode }}" |
Member
There was a problem hiding this comment.
since we're shelling out to dpkg-query anyway, could we use something like the package facts module instead that might be natively check-safe? @natefoo ?
Contributor
Author
There was a problem hiding this comment.
Do you think it is ok even though it has the following requirements?
REQUIREMENTS
The below requirements are needed on the host that executes this module.
For ‘portage’ support it requires the qlist utility, which is part of ‘app-portage/portage-utils’. For Debian-based systems python-apt package must be installed on targeted hosts.
Contributor
Author
There was a problem hiding this comment.
Yeah, I thought so....
So should we move with this PR? Or any other suggestion?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ok, even with the small fix I proposed in #38, it was still not working in check_mode (because a bunch of reasons).
So this PR aims to make it work also with in
--check(check mode). I had to set a small "hack" to make it work because neithercommandnotshelleffectively run in check_mode, so we couldn't get the current version result from them (using dpkg shell command).