Porting playbooks from Ansible 2.4 to newer version

37 views
Skip to first unread message

Lienj

unread,
Dec 31, 2018, 10:52:32 AM12/31/18
to Ansible Project
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.

Piyush Bansal

unread,
Dec 31, 2018, 1:17:21 PM12/31/18
to ansible...@googlegroups.com
Hello Julien,

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

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 received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ab812297-5990-42f8-9754-669e124ad26c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kai Stian Olstad

unread,
Jan 1, 2019, 5:17:17 AM1/1/19
to ansible...@googlegroups.com
On Monday, 31 December 2018 16:52:32 CET Lienj wrote:
> There are a lot of changes from 2.4 to 2.5 mainly:
>
> - Loops (with_item vs loop)

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


--
Kai Stian Olstad


John Favorite

unread,
Jan 1, 2019, 10:37:18 AM1/1/19
to Ansible Project
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!

--

Lienj

unread,
Jan 29, 2019, 7:26:01 AM1/29/19
to Ansible Project
Thanks all, you were right this was not a big amount of work.
Reply all
Reply to author
Forward
0 new messages