rax module - no host-pattern?

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

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!

Hi Michael,

Thanks for that! Seems to at least give me a different error now, but that’s to do with pyrax :slight_smile: 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

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.

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?

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.

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 :wink:

Thanks for the help!