Merge "You have to use egrep to get real regexes"
This commit is contained in:
commit
0cbc22b00f
@ -25,7 +25,7 @@ for line in $(</etc/ansible/groups.txt); do
|
|||||||
name=$(echo $line | cut -f1 -d' ')
|
name=$(echo $line | cut -f1 -d' ')
|
||||||
pattern=$(echo $line | cut -f2 -d' ')
|
pattern=$(echo $line | cut -f2 -d' ')
|
||||||
echo "[${name}]" >> $outfile
|
echo "[${name}]" >> $outfile
|
||||||
ansible "~${pattern}" --list-hosts | grep -v '^ +hosts \([0-9]+\):' >> $outfile
|
ansible "~${pattern}" --list-hosts | egrep -v '^ +hosts \([0-9]+\):' >> $outfile
|
||||||
done
|
done
|
||||||
|
|
||||||
cp $outfile /etc/ansible/hosts/generated-groups
|
cp $outfile /etc/ansible/hosts/generated-groups
|
||||||
|
Loading…
x
Reference in New Issue
Block a user