On Saturday, 9 November 2013 12:02:48 UTC+2, Mikhail Sobolev wrote:
>
> Hi,
>
> (Disclaimer: I'm very new to ansible so I easily might miss something very 
> straightforward.)
>
> I have a number of sites, e.g. site1, site2, ..., siteN.  Each site has a 
> number of machines that play a particular "role", e.g. roleA1, roleA2, 
> roleB1, roleC1, ...
>
> I easily created an inventory for sites:
>
>   [siteX]
>   roleA1.siteX.example.com
>   ...
>
> However I could not find a way to have a special group for all available 
> roleY machines.  I tried
>
>   [roleY]
>   roleY[1:9].*.example.com
>
> but the result was not what I expected.
>
> Any suggestions on what I should read to better understand how the things 
> work?
>
Thanks, Brian.

As we discussed today on IRC:

20:54 <sa2ajj> my site names are 0000 ... 9999 (not that many yet, but they 
grow :))
20:54 <sa2ajj> so i'd specify [0000:9999]?
20:54 <bcoca> [0000:9999]
20:54 <bcoca> yep
20:55 <sa2ajj> interesting: it's so simple :)  meanwhile i wrote a dynamic 
inventory :)
20:57 <sa2ajj> ah...
20:58 <sa2ajj> i just realised: the example i gave in the post, is not 
totally accurate :(
20:59 <sa2ajj> the host name looks like 
roleX.siteYYYY.<area>.<kind>.example.com
21:00 <sa2ajj> where <area> is geographical area (can be 0-2 components), 
and <kind> is either "test" (where <area> is not present) or "prod" (where 
<area> is 1-2 name components)
21:00 <sa2ajj> bcoca: do you think i could use ranges in this case as well?
21:01 <bcoca> not sure

So, I will stick to my dynamic inventory script for now.

-- 
Misha

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to