# New "with\_random\_choice" lookup plugin

**URL:** <https://forum.ansible.com/t/new-with-random-choice-lookup-plugin/12283>\
**Category:** Ansible Project\
**Created:** [February 2, 2013, 6:06pm UTC](https://forum.ansible.com/t/new-with-random-choice-lookup-plugin/12283 "2013-02-02T18:06:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 2, 2013, 6:06pm UTC](https://forum.ansible.com/t/new-with-random-choice-lookup-plugin/12283/1 "2013-02-02T18:06:59Z")

</div>

It may be that you desire to introduce a degree of randomness into  
your executions. One example of this is you may have a selection of  
mirrors you want to choose semi-fairly between. Another, is you might  
have been inspired by Chaos Monkey, and want to keep your network  
administrators on their toes!

I've added a new plugin that allows just this:

---

<div class="post-metadata">

**Author:** ![Jim\_Richardson](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@Jim\_Richardson](https://forum.ansible.com/u/Jim_Richardson)\
**Post date:** [February 2, 2013, 10:09pm UTC](https://forum.ansible.com/t/new-with-random-choice-lookup-plugin/12283/2 "2013-02-02T22:09:47Z")

</div>

On that note, I've started a small project on github to reimplement  
the bits of chaos monkey that I find useful, in python. It's written  
with an eye to using it as an ansible module, (though not limited to  
that) Currently it can kill a random pid pretty well, adding more  
monkey flinging poo options as time goes by. If anyone is interested.

[https://github.com/weaselkeeper/UsefulIdiot.git](https://github.com/weaselkeeper/UsefulIdiot.git)

Apologies if this is considered off topic.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 2, 2013, 10:30pm UTC](https://forum.ansible.com/t/new-with-random-choice-lookup-plugin/12283/3 "2013-02-02T22:30:15Z")

</div>

Totally not.

When I first saw that I was thinking, "darn, too bad it's EC2 specific".

Incidentally I was going to write a cobbler module, you'll be able to  
flip power with it and stuff.

Fence module should probably be seperate and slightly redundant.  
Going to do that too, but much groundwork has been done there with  
cobbler power integration so it's cake.

--Michael
