From 2aef6131c2b038b472f7d38de74cfc8b54636a2b Mon Sep 17 00:00:00 2001 From: Sergey Trofimov Date: Mon, 14 Sep 2015 22:28:34 +0300 Subject: [PATCH] Ignore comments in ansible hosts --- src/_ansible | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_ansible b/src/_ansible index faabf04..a4c59a3 100644 --- a/src/_ansible +++ b/src/_ansible @@ -91,7 +91,7 @@ __host_list () local -a mixed_host_list mixed_host_list=$(command \ cat ${HOST_FILE} \ - | awk 'NF && $1 !~ /[\[:=]/ { print $1 }' \ + | awk 'NF && $1 !~ /^[:space:]*#|[\[:=]/ { print $1 }' \ | sort | uniq) # compute set difference h1 - h2