I am having trouble filtering hosts (using the --limit switch) in the command line by specifying the static inventory hosts group that the hosts are part if said hosts are also returned by the Google Compute Engine dynamic inventory script. I have to specify the individual hosts instead as a workaround. Is this a known issue?
–Pedro.
There isn’t an issue with --limit and dynamic groups at all.
Can you explain what you are trying in more detail?
My guess is you may have named the group something and GCE is returning a different group name, thus you’ve limited yourself to 0 hosts.
Commands and output would be helpful.
Thanks for the tip about group names having to match, Michael. I assumed the match would be done by host name even if the hosts belonged to differently named groups. Going back to read the gce.py docstring, I learned that the discovered hosts where grouped in a tag_ group and using the same name in the static inventory made it all work like I expected.
–Pedro.