Can Ansible unarchive be made to write static folder modification times? Can Ansible unarchive be made to write static folder modification times? wordpress wordpress

Can Ansible unarchive be made to write static folder modification times?


Rather than overwriting all files each time and find a way to keep the same modification datetime, you may want to use the creates option of the unarchive module.

As you maybe already know, this tells Ansible that a specific file/folder will be created as a result of the task. Thus, next time the task will not be run again if that file/folder already exists.

See http://docs.ansible.com/ansible/unarchive_module.html#options


My solution is to modify the checksum script and to make that a permanent feature of the Ansible process. It feels a bit hacky to do my own checksumming, when Ansible should do it for me, but it works.

New answers that explain that I am doing something wrong, or that a new version of Ansible fixes the problem, would be most welcome.

If I get a moment, I will raise this as a possible bug with the Ansible team. However I do sometimes wonder about the effort/reward ratio when raising bugs on a busy tracker - I already have one item outstanding, it has been waiting a while, and I've chosen to work around that too.

Update (18 months later)

This Ansible build system never made it into live. It felt like I was always working around something. Recently, when I decided I needed to move my blog to another server, I finally Dockerised it. This took several weeks (since there is a surprising amount of things to think about in a real WordPress installation) but in general I found the process much nicer than using orchestration tools.