# rax module - no host-pattern?

**URL:** <https://forum.ansible.com/t/rax-module-no-host-pattern/13313>\
**Category:** Ansible Project\
**Created:** [August 15, 2013, 12:08pm UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313 "2013-08-15T12:08:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seumas\_Mackinnon](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@Seumas\_Mackinnon](https://forum.ansible.com/u/Seumas_Mackinnon)\
**Post date:** [August 15, 2013, 12:08pm UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313/1 "2013-08-15T12:08:42Z")

</div>

Hi all,

I’m trying to use the rax module from the command line to create a new cloudserver. But I can’t figure out what to use as the “host-pattern”. I’m creating a new server, so there _is_ no “host” as such! The docs don’t seem to explain what you’re supposed to do in this situation. I tried “localhost” but it just said “No hosts matched”

Any ideas please?

Many thanks, Seumas

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [August 15, 2013, 12:37pm UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313/2 "2013-08-15T12:37:19Z")

</div>

You will want to put localhost in inventory.

We have an action item to implicitly allow localhost to not be in inventory when specified directly in the future.

Easy enough!

---

<div class="post-metadata">

**Author:** ![Seumas\_Mackinnon](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@Seumas\_Mackinnon](https://forum.ansible.com/u/Seumas_Mackinnon)\
**Post date:** [August 15, 2013, 1:08pm UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313/3 "2013-08-15T13:08:55Z")

</div>

Hi Michael,

Thanks for that! Seems to at least give me a different error now, but that’s to do with pyrax 🙂 Might I suggest that the documentation be updated to specify that modules that don’t take a hostname should be given the hostname “local”? (maybe it does say it somewhere, but I couldn’t find it)

Cheers, Seumas

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [August 15, 2013, 1:50pm UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313/4 "2013-08-15T13:50:56Z")

</div>

It is possible that you might want to run modules from some other server (for instance, a more secured central server that has the authentication keys), so in that case we can’t hard-code any module to only run locally.

---

<div class="post-metadata">

**Author:** ![Seumas\_Mackinnon](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@Seumas\_Mackinnon](https://forum.ansible.com/u/Seumas_Mackinnon)\
**Post date:** [August 16, 2013, 11:24am UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313/5 "2013-08-16T11:24:10Z")

</div>

Hi James,

I’m not sure I understand this. What’s the effect of specifying a different hostname/pattern for the rax module?

Why would it need one at all?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [August 16, 2013, 11:57am UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313/6 "2013-08-16T11:57:08Z")

</div>

Exactly what James said above.

You may wish to communicate with rax from a central server.

It doesn’t just apply to rax, it could be any set of machines where you want to log in and initiate API traffic from a specific point.

---

<div class="post-metadata">

**Author:** ![Seumas\_Mackinnon](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@Seumas\_Mackinnon](https://forum.ansible.com/u/Seumas_Mackinnon)\
**Post date:** [August 16, 2013, 12:57pm UTC](https://forum.ansible.com/t/rax-module-no-host-pattern/13313/7 "2013-08-16T12:57:54Z")

</div>

Ok, I think my mental model of ansible was wrong. I was thinking of it as “do something to these servers” rather than “run this module on these servers”. A small, but profound, difference 😉

Thanks for the help!
