From 9367e61fd94f37ebf0db568c3694f60bd3d59d29 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 18 Jan 2016 17:28:30 -0500 Subject: [PATCH] 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 --- modules/openstack_project/files/puppetmaster/expand-groups.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openstack_project/files/puppetmaster/expand-groups.sh b/modules/openstack_project/files/puppetmaster/expand-groups.sh index 4526fc056d..fb15ea61bb 100644 --- a/modules/openstack_project/files/puppetmaster/expand-groups.sh +++ b/modules/openstack_project/files/puppetmaster/expand-groups.sh @@ -25,7 +25,7 @@ for line in $(> $outfile - ansible "~${pattern}" --list-hosts >> $outfile + ansible "~${pattern}" --list-hosts | grep -v '^ +hosts \([0-9]+\):' >> $outfile done cp $outfile /etc/ansible/hosts/generated-groups