Porting playbooks from Ansible 2.4 to newer version

Hi there,
we have a bunch of playbooks and roles, all written in Ansible version >= 2.4
I need to audit all our playbooks in order to migrate to a more recent version.
There are a lot of changes from 2.4 to 2.5 mainly:

  • Loops (with_item vs loop)
  • Attributes inheritances

I don’t know how to handle that, do you have any methods for first auditing what need to be changed and then ensure the changes are valid (from a syntax point of view) ?
Thanks.

Hello Julien,

First and foremost thing is to refer to porting guide for your target version.

Ansible 2.5 Porting Guide

This will give you information about what have changed and you can change them in your older version.

Basic idea is:
Track the modules which have changed in the target version.
List down the modules you have used in the existing version
Compare both of them and make the necessary changes afterwards.
If you have roles implemented then it might be faster to check in the roles, for what all modules you have implemented.
But all manual efforts.

You don't need to do anything with this, with_items is not deprecated.

We just did this on my team. We went from 2.3.2.0(!) ==> 2.5.8 (we’ll bump up once a couple rabbitmq module bugs are resolved).

So, how did we do it? Installed the latest ansible and ran our playbooks, iterating through issues found until everything ran successful. As I noted above, we had some rabbitmq module issues which prevented from going past 2.5.8. Once we had that all worked out, we resolved the deprecated warnings. This puts us in a better place to more rapidly upgrade in the future.

I’m happy to helping if you run into any major issues. Best of luck!

Thanks all, you were right this was not a big amount of work.