Inventory pattern not matching in runbook

Hello,

I’ve got a simple inventory file setup and am using Ansible 1.8

`
[tl-prod-mongo]
tl-prod-mgdb-[01:06]

[tl-prod-web]
tl-prod-aweb-[01:06]
tl-prod-bweb-[01:06]
tl-prod-cweb-[01:06]
`

However, the following runbook fails to match any hosts

`

try removing the - from the names, use _ instead.

Thanks, that works for the group names. But what if I’m just trying to specify 2 hosts inside a group of 6? Would I have to put them all in groups to get around this?

Is a - (dash) an invalid character for hostnames in Ansible? Or is it splitting on that somewhere when it shouldn’t be?

Jay

the - is problematic with python dictionaries, which is what group
names end up being, hosts should be fine.

list slices (hostgroup[:2]) should work

Well, when I try with hosts

ansible -m ping tl-prod-mgdb-[01:03]
No hosts matched

ansible -m ping tl-prod-mgdb-[:03]
No hosts matched

But…this works as long as I change the group name
ansible -m ping tl_prod_mongo

Maybe the dash is problematic for hosts as well?

Jay