How I Fixed: File is absent cannot continue

Lately I’ve been tidying up my Ansible playbook scripts ahead of a forthcoming project deployment. Lots of change, including upgrading to PHP7 across the board.

Pretty cool, and exciting, but quite a lot of work all the same.

I decided to take the opportunity to restructure my log files. I mean, that’s a good way to spend a Friday night, right? Of course it is.

The relevant part of the nginx playbook is:

It’s admittedly been a while since I’ve been regularly hands-on with my Ansible setup, so I was a little rusty. See if you can spot the error in the above.

The with_items section lives in my  host_vars/ file, and looks like:

So, anyway the error that was being spat out was as follows:

Hopefully it make it easier to Google for this for someone in the future.

Anyway, the solution will make you kick yourself. I can’t imagine that many people will make this typo, but you never know:

Yeah… d’oh. RTFM.

Though to be fair, I had RTFM, it was just a long time ago, and I guess I rely too heavily on IDE code completion. When it comes to Sublime + YAML, I am going to make mistakes 🙂

If this looks interesting to you, and you want to know more about Ansible, be sure to check out the tutorial series I did here at Code Review Videos.

It’s shameless self promotion, I know, but hey, it is free. And hopefully you find it useful.


Published by

Code Review

Code Review

CodeReviewVideos is a video training site helping software developers learn Symfony faster and easier.

Leave a Reply

Your email address will not be published. Required fields are marked *