mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Ignore commented out lines in the ansible setup files.
This commit is contained in:
parent
e284c8cedc
commit
60a13cf540
1 changed files with 6 additions and 0 deletions
|
@ -127,10 +127,16 @@ class Runner(object):
|
||||||
group_name = 'ungrouped'
|
group_name = 'ungrouped'
|
||||||
results = []
|
results = []
|
||||||
for item in lines:
|
for item in lines:
|
||||||
|
item = item.lstrip().rstrip()
|
||||||
|
if item.startswith("#"):
|
||||||
|
# ignore commented out lines
|
||||||
|
continue
|
||||||
if item.startswith("["):
|
if item.startswith("["):
|
||||||
|
# looks like a group
|
||||||
group_name = item.replace("[","").replace("]","").lstrip().rstrip()
|
group_name = item.replace("[","").replace("]","").lstrip().rstrip()
|
||||||
groups[group_name] = []
|
groups[group_name] = []
|
||||||
else:
|
else:
|
||||||
|
# looks like a regular host
|
||||||
groups[group_name].append(item)
|
groups[group_name].append(item)
|
||||||
results.append(item)
|
results.append(item)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue