# Re-Use role To Complete multi-stage Upgrade

**URL:** <https://forum.ansible.com/t/re-use-role-to-complete-multi-stage-upgrade/35104>\
**Category:** Ansible Project\
**Created:** [May 4, 2021, 12:41am UTC](https://forum.ansible.com/t/re-use-role-to-complete-multi-stage-upgrade/35104 "2021-05-04T00:41:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clint\_Denham](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Clint\_Denham](https://forum.ansible.com/u/Clint_Denham)\
**Post date:** [May 4, 2021, 12:41am UTC](https://forum.ansible.com/t/re-use-role-to-complete-multi-stage-upgrade/35104/1 "2021-05-04T00:41:34Z")

</div>

Somewhat new to Ansible Roles and I can’t sort it out in my head how to do this.

I have a situation where I need to upgrade 2 target devices from software code v1 → v2 and once that is completed on both devices, then upgrade the devices from from software code v2 → v3

The role I have is structured like this

- { role: “init”, when: (upgrade\_success == true | bool) }
- { role: “pre-upgrade”, when: (upgrade\_success == true | bool) }
- { role: “upgrade”, when: (upgrade\_success == true | bool) }
- { role: “post-upgrade”, when: (upgrade\_success == true | bool) }

I have a variable defined ‘ISO\_IMAGE\_1’ that installs the v2 software and this role completes normally for the upgrade from v1 → v2

What I would like to do is re-use this same role roles above for upgrading from v2 → v3 and when this role is run a 2nd time, I’d like to pass the variable ‘ISO\_IMAGE\_2’.

2 questions
