diff --git a/src/_ansible b/src/_ansible index 0440e3e..09d769b 100644 --- a/src/_ansible +++ b/src/_ansible @@ -73,9 +73,10 @@ __ll_group_list () { local -a group_list group_list=$(command \ cat ${HOST_FILE} \ - | awk '$1 ~ /^\[.*\]$/ && !/[:=]/ { gsub(/[\[\]]/, "", $1); print $1 }' \ + | awk '$1 ~ /^\[.*\]$/ && !/=/ && !/:vars/ \ + { gsub(/[\[\]]/, "", $1); gsub(/:children/, "", $1) ; print $1 }' \ | uniq ) - + echo ${group_list} } diff --git a/src/_ansible-playbook b/src/_ansible-playbook index bbeccc0..a7d9ef8 100644 --- a/src/_ansible-playbook +++ b/src/_ansible-playbook @@ -72,9 +72,10 @@ __ll_group_list () { local -a group_list group_list=$(command \ cat ${HOST_FILE} \ - | awk '$1 ~ /^\[.*\]$/ && !/[:=]/ { gsub(/[\[\]]/, "", $1); print $1 }' \ + | awk '$1 ~ /^\[.*\]$/ && !/=/ && !/:vars/ \ + { gsub(/[\[\]]/, "", $1); gsub(/:children/, "", $1) ; print $1 }' \ | uniq ) - + echo ${group_list} }