Le 15/01/04 12:34, Francisco Reyes claviotta :
>
> I manage multiple clients, and my servers are named using the following
>
>
Nope. Patterns can only be used when calling ansible. It would be
awesome to use the same syntax in host definition, but we can't.
In addition to the suggestion of using patterns, which sounds like what you
were looking for, perhaps another option may be to use different host files.
I also use ansible for clients, but my clients requirements are so
different that other than some common roles the hosts are too different.
Are your client machines all similar? Is it something like the same type of
setup for multiple clients?
Yes, all my clients have the same needs. Of course I have some
specific playbooks that can only be used on one client (like deploying
an app), but the majority is common.
The typical example is the playbook which creates Unix accounts. It is
using a list "admins" in the inventory. This list is declared in
group_vars/ for all my clients (group_vars/foo, group_vars/bar…).
So what I'm looking for is to include foo-* servers in the "foo"
group, without having to list them one by one.
But I have read all the source code of the inventory, and my
conclusion is that it's not possible. This is not the first time I
feel disappointed by the inventory of Ansible. I really love
everything else, but the inventory becomes completely unusable when it
grows.
So I wrote a new inventory parser. I will submit it on Github soon.
Thanks for your answers.