Merge "You have to use egrep to get real regexes"

This commit is contained in:
Jenkins 2016-01-18 23:52:01 +00:00 committed by Gerrit Code Review
commit 0cbc22b00f
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ for line in $(</etc/ansible/groups.txt); do
name=$(echo $line | cut -f1 -d' ')
pattern=$(echo $line | cut -f2 -d' ')
echo "[${name}]" >> $outfile
ansible "~${pattern}" --list-hosts | grep -v '^ +hosts \([0-9]+\):' >> $outfile
ansible "~${pattern}" --list-hosts | egrep -v '^ +hosts \([0-9]+\):' >> $outfile
done
cp $outfile /etc/ansible/hosts/generated-groups