You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ansible check_mode allows determining if a task would have changed something, but only on the level of an entire play.
But there are obvious cases where idempotency requires being able to change the order of events - i.e. check if a file would be changed, if so, stop a daemon and change the file - otherwise do nothing.
This can be replicated by comparing mtimes locally and remotely, but leads to complicated syntax for something the existing feature can already provide.
This is simple and readable, and helps in dealing with services which may be monitoring config directories for new files but which would might like to try and avert for changes like that (exim with a perl interpreter can be a problem in this regard).
The text was updated successfully, but these errors were encountered:
I wanted to do exactly the same thing and, after some discussion on the list, I submitted #7439 at mpdehaan's request, but then he decided he didn't want it after all. The code won't apply any more, I imagine, but it should be easy enough to adapt for v2 if you're interested.
This would also make testcases a lot nicer to write. The check_mode support in many modules is flaky, since they are not thoroughly tested. Currently in the integration tests only the template module is included. For some modules (i.e. git) the code in check_mode differs quite a bit from normal mode.
Ansible check_mode allows determining if a task would have changed something, but only on the level of an entire play.
But there are obvious cases where idempotency requires being able to change the order of events - i.e. check if a file would be changed, if so, stop a daemon and change the file - otherwise do nothing.
This can be replicated by comparing mtimes locally and remotely, but leads to complicated syntax for something the existing feature can already provide.
Ideally something like this would be possible:
This is simple and readable, and helps in dealing with services which may be monitoring config directories for new files but which would might like to try and avert for changes like that (exim with a perl interpreter can be a problem in this regard).
The text was updated successfully, but these errors were encountered: