# Porting playbooks from Ansible 2.4 to newer version

**URL:** <https://forum.ansible.com/t/porting-playbooks-from-ansible-2-4-to-newer-version/29342>\
**Category:** Ansible Project\
**Created:** [December 31, 2018, 3:52pm UTC](https://forum.ansible.com/t/porting-playbooks-from-ansible-2-4-to-newer-version/29342 "2018-12-31T15:52:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_Deloubes](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@Julien\_Deloubes](https://forum.ansible.com/u/Julien_Deloubes)\
**Post date:** [December 31, 2018, 3:52pm UTC](https://forum.ansible.com/t/porting-playbooks-from-ansible-2-4-to-newer-version/29342/1 "2018-12-31T15:52:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Piyush\_Bansal](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@Piyush\_Bansal](https://forum.ansible.com/u/Piyush_Bansal)\
**Post date:** [December 31, 2018, 6:16pm UTC](https://forum.ansible.com/t/porting-playbooks-from-ansible-2-4-to-newer-version/29342/2 "2018-12-31T18:16:59Z")

</div>

Hello Julien,

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

# [Ansible 2.5 Porting Guide](https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html#id1)

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.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 1, 2019, 10:17am UTC](https://forum.ansible.com/t/porting-playbooks-from-ansible-2-4-to-newer-version/29342/3 "2019-01-01T10:17:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![John\_Favorite](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@John\_Favorite](https://forum.ansible.com/u/John_Favorite)\
**Post date:** [January 1, 2019, 3:36pm UTC](https://forum.ansible.com/t/porting-playbooks-from-ansible-2-4-to-newer-version/29342/4 "2019-01-01T15:36:57Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Julien\_Deloubes](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@Julien\_Deloubes](https://forum.ansible.com/u/Julien_Deloubes)\
**Post date:** [January 29, 2019, 12:26pm UTC](https://forum.ansible.com/t/porting-playbooks-from-ansible-2-4-to-newer-version/29342/5 "2019-01-29T12:26:01Z")

</div>

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