-
Notifications
You must be signed in to change notification settings - Fork 43
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
Errors in check mode #27
Comments
Are you running Ansible with I think it's this task that is being skipped in check mode. Lines 59 to 65 in d55dd3e
And this line of the template that would like to use the variable and then proceeds to throw a semi-helpful error message (the stuff about "Version comparison" gave me the hint). timesync/templates/ntp.conf.j2 Line 16 in d55dd3e
Does it work if you run it without |
OK - this seems to have been the issue - I have added a "check_mode: no" in that paragraph so now I can run the whole role in check mode as well. In our environment we need to be able to run everything in check mode. Many Thanx |
@hhaniel what paragraph do you mean, the "Get ntp version" task? We could add the |
I have added it in line 65: 59 - name: Get ntp version If you could modify this from your side that would be great since we would like to stick to the core code rather then branching it in our environment. |
The same goes by the way for the chrony version check - I had to do the same there. |
Yeah, there will be multiple instances of this problem, and in the other roles as well. |
Force the command tasks to run in normal mode in order to allow the role to run in check mode. Also, change "False" to "no" for consistency. Fixes linux-system-roles#27.
Consider above attached main.yml file - I have made modifications to it so it can run cleanly in check mode and in apply mode. So it checks if certain rpm's are installed before services are enabled or disabled. If a service is not installed (like linuxptp) the specific tasks for them are skipped where they may cause an error or in check mode they will come back as changed even though nothing has changed. I have only tested this with installing NTP in anger as we do not use any of the other services in our environment yet. |
Force the command tasks to run in normal mode in order to allow the role to run in check mode. Also, change "False" to "no" for consistency. Fixes linux-system-roles#27.
Force the command tasks to run in normal mode in order to allow the role to run in check mode. Fixes linux-system-roles#27.
Force the command tasks to run in normal mode in order to allow the role to run in check mode. Fixes #27.
linux-system-roles#27 (comment) Change molecule setup to run check mode at the beginning (don't forget to change it back to original state later).
Hi @hhaniel , thanks for your contribution. I thought that we fixed the check mode issues, but now I see that your change fixes one case that still is not working properly: the case when the role has not been applied previously, and therefore packages assumed to exist are missing. I've opened #51 to track this. |
linux-system-roles#27 (comment) Use package_facts to check whether the package is installed and to determine package version.
Based on: linux-system-roles#27 (comment) Skip all tasks that assume that some package is installed if it actually isn't.
Based on: linux-system-roles#27 (comment) Skip all tasks that assume that some package is installed if it actually isn't.
Based on: linux-system-roles#27 (comment) Skip all tasks that assume that some package is installed if it actually isn't.
Based on: linux-system-roles#27 (comment) Skip all tasks that assume that some package is installed if it actually isn't.
I am playing with this module for the first time - still slightly inexperienced with ansible but following the instructions and hitting a wall generating ntp.conf
TASK [linux-system-roles.timesync : Generate ntp.conf file] ********************************************
fatal: [tumbleweed-x]: FAILED! => {"changed": false, "msg": "AnsibleFilterError: Version comparison: 'dict object' has no attribute 'stdout'"}
I am trying to get the basics to work and then looking at modifying this role/module to incorporate settings for timekeeper. - I am also looking for options to use this on SLES if possible.
The text was updated successfully, but these errors were encountered: