# Repeat a block with a different variable?

**URL:** <https://forum.ansible.com/t/repeat-a-block-with-a-different-variable/27200>\
**Category:** Ansible Project\
**Created:** [April 6, 2018, 12:04am UTC](https://forum.ansible.com/t/repeat-a-block-with-a-different-variable/27200 "2018-04-06T00:04:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeamHall](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leamhall/32/9390_2.png) [@LeamHall](https://forum.ansible.com/u/LeamHall)\
**Post date:** [April 6, 2018, 12:04am UTC](https://forum.ansible.com/t/repeat-a-block-with-a-different-variable/27200/1 "2018-04-06T00:04:20Z")

</div>

Still more Ansible newbie than journeyman. Trying to figure out how to  
re-run a block with a different variable.

Issues:

1. Ruby must be installed to compile new versions of Ruby.  
2. The CentOS 6 default version of Ruby is too old to compile the newest Ruby.

Plan:

1. Ensure default Ruby is installed.  
2. Clone the Ruby git repo.  
2.1. Change to an intermediate version's branch (2.0.0, arbitrary but compiles)  
2.2. Do a basic compile and install  
3. Remove the default Ruby

The next step, and thus my question, is how to rerun the  
autoconf/configure/make etc steps with the trunk branch. In theory I  
can just remove the entire git clone and start over. Is there a better  
way? What is it?

[https://github.com/LeamHall/Ansible\_Test/blob/master/playbooks/dev\_station.yml#L135-L179](https://github.com/LeamHall/Ansible_Test/blob/master/playbooks/dev_station.yml#L135-L179)

Thanks!

Leam

---

<div class="post-metadata">

**Author:** ![LeamHall](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/leamhall/32/9390_2.png) [@LeamHall](https://forum.ansible.com/u/LeamHall)\
**Post date:** [April 6, 2018, 12:21am UTC](https://forum.ansible.com/t/repeat-a-block-with-a-different-variable/27200/2 "2018-04-06T00:21:08Z")

</div>

Most recent git push changed the line numbers to:

[https://github.com/LeamHall/Ansible\_Test/blob/master/playbooks/dev\_station.yml#L142-L188](https://github.com/LeamHall/Ansible_Test/blob/master/playbooks/dev_station.yml#L142-L188)
