The idea here is that if the /path/to/database file already exists,
the command doesn't run. This is a poor man's way of adding idempotence.
But, what if a previous module, or external command, created a new
version of /path/to/database that requires the command to be run again?
The mere fact that /path/to/database exists isn't sufficient to
determine with the command should be run again. Instead, it's the
combination of whether the file exists, and its contents.
What if there were an addition argument called "with_sha1hash" that
contains a hash value to use to recognize whether /path/to/database has
changed. For example,
(The hash value can be enough of the first characters of the hash to
be unique, the way Git does things).
If /path/to/database exists, but it doesn't have "ab34ac" as
its sha1 hash, the command would be run.
This would be an optional argument so it wouldn't affect
any existing playbooks.
I have to admit I don't have any examples of when this would be
necessary but it seems like such a thing could exist. Does this
make sense?
Jon Forrest
Dick Davies
unread,
Nov 26, 2016, 11:29:40 AM11/26/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible list
It's not a bad idea, but it would need a bit of work to cater to
things like directories.
I often use a task like this to create automatically versioned
directory names if I can't
find an RPM: