# Mixing "module: rax" with "with\_sequence", mixed results.

**URL:** <https://forum.ansible.com/t/mixing-module-rax-with-with-sequence-mixed-results/13765>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 24, 2013, 8:28pm UTC](https://forum.ansible.com/t/mixing-module-rax-with-with-sequence-mixed-results/13765 "2013-10-24T20:28:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Casey](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mark\_Casey](https://forum.ansible.com/u/Mark_Casey)\
**Post date:** [October 24, 2013, 8:28pm UTC](https://forum.ansible.com/t/mixing-module-rax-with-with-sequence-mixed-results/13765/1 "2013-10-24T20:28:42Z")

</div>

I’ve been hacking at the openshift example to try and create a rig where you can create or remove virtual hosts in either ec2 or rax, controlled by just giving an additional “-e” var on the command line. (though what I have is no longer related to deploying openshift). I’ve got the 1.3.3 version of Ansible from the Ubuntu precise PPA.

**Question:**

1. Can I mix with\_sequence, rax, and register like this? Most of the vars are set in group\_vars/all; the vars ‘id’, and ‘type’ are being set in the playbook that calls this role.

This all works fine without the with\_sequence part, but then it’s one at a time and so requires more calls to the role, and that breaks some other things.

**Role excerpt:**

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [October 24, 2013, 9:22pm UTC](https://forum.ansible.com/t/mixing-module-rax-with-with-sequence-mixed-results/13765/2 "2013-10-24T21:22:42Z")

</div>

Mark,

Have a look at a response I made in regards to this same topic a few weeks back:

\<[https://groups.google.com/d/msg/ansible-project/Gh6EL6uuBkA/xZcb2dKrncgJ](https://groups.google.com/d/msg/ansible-project/Gh6EL6uuBkA/xZcb2dKrncgJ)\>

Basically, when you use with\_sequence, it nests the ‘instances’ attribute a bit deeper.

You might also want to follow along on the ‘rax module refactor’ ticket \<[https://github.com/ansible/ansible/issues/4577](https://github.com/ansible/ansible/issues/4577)\> I’ve been doing a bit of work to add ‘count’ functionality there.

---

<div class="post-metadata">

**Author:** ![Mark\_Casey](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@Mark\_Casey](https://forum.ansible.com/u/Mark_Casey)\
**Post date:** [October 24, 2013, 9:53pm UTC](https://forum.ansible.com/t/mixing-module-rax-with-with-sequence-mixed-results/13765/3 "2013-10-24T21:53:24Z")

</div>

I appreciate it and sorry for the dup.

I didn’t realize or possibly didn’t remember that debug could print structures, though it makes sense.

I’d seen the rax.py work, but not the rax module. Looking forward to that quite a bit…thanks for your work on those.
