Mixing "module: rax" with "with_sequence", mixed results.

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:

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>

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> I’ve been doing a bit of work to add ‘count’ functionality there.

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.