5 Commits

Author SHA1 Message Date
Monty Taylor
4b8b02bc7a Also protected against OS env vars in expand-groups
If we unset these in the script, it will protect us further.

Change-Id: Ic7370411df3742d1d76be08fda68cf701458e87c
2016-03-22 19:34:17 -05:00
Monty Taylor
765c1474b7 Use groups.txt for disabling hosts for puppet
We already have a dynamic system for managing static group management.
Use it for the disabled group so that the rules for managing the members
are not different.

Also, update the disabled list to match reality.

Also, Update docs because hosts are no longer groups

The upstream OpenStack Inventory in Ansible was fixed to no longer
return each cloud host as its own group unless there are duplicates for
the host in question. This  means it's no longer the right thing to do
to put hosts into disabled:children - disabled is just fine.

Change-Id: I95c83ed64801db15ad99a14547895f3520356f99
2016-01-20 11:38:20 -05:00
Monty Taylor
45efc4afc9 You have to use egrep to get real regexes
How is this still the case in 2016?

Change-Id: I3de8832bb1b86fd822f10ce35b695f10f4f8a652
2016-01-18 18:29:56 -05:00
Monty Taylor
9367e61fd9 Exclude hosts header line in expand-groups
Ansible --list-hosts output looks like this:

  root@puppetmaster:~# ansible logstash-worker --list-hosts
    hosts (20):
      loggstash-worker01.openstack.org

Which means we need to strip out the hosts (20): line.

Change-Id: Id2ab90baadcf13836f9d605bab1cf13ebf3c1a70
2016-01-18 17:42:26 -05:00
Monty Taylor
7699226007 Add script to make ansible groups from patterns
We have a set of hostname patterns which is not a thing that ansible
supports in inventory files. While we can put hostname patterns into
playbooks directly, that does not help us with copying hiera group files
since ansible doesn't know about the groups in site.pp and puppet
doesn't know about the ansible groups.

Instead, do a quick expansion any time the groups.txt file changes and
at the end of launch-node. It will be left to admins to run
expand-groups.sh whenever they delete a node.

Change-Id: I00c60748ddb2d35a3b98f78d828dabebcf065118
2016-01-15 12:13:00 -05:00