mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Ignore commented out lines in the ansible setup files.
This commit is contained in:
@@ -127,10 +127,16 @@ class Runner(object):
|
||||
group_name = 'ungrouped'
|
||||
results = []
|
||||
for item in lines:
|
||||
item = item.lstrip().rstrip()
|
||||
if item.startswith("#"):
|
||||
# ignore commented out lines
|
||||
continue
|
||||
if item.startswith("["):
|
||||
# looks like a group
|
||||
group_name = item.replace("[","").replace("]","").lstrip().rstrip()
|
||||
groups[group_name] = []
|
||||
else:
|
||||
# looks like a regular host
|
||||
groups[group_name].append(item)
|
||||
results.append(item)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user