Remove line when 'state: absent' with 'option:' instead of commenting
This commit is contained in:
parent
29978344ea
commit
4c830400f8
1 changed files with 3 additions and 3 deletions
|
@ -185,10 +185,10 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese
|
||||||
else:
|
else:
|
||||||
index = index + 1
|
index = index + 1
|
||||||
break
|
break
|
||||||
else:
|
elif state == 'absent':
|
||||||
# comment out the existing option line
|
# delete the existing line
|
||||||
if match_active_opt(option, line):
|
if match_active_opt(option, line):
|
||||||
ini_lines[index] = '#%s' % ini_lines[index]
|
del ini_lines[index]
|
||||||
changed = True
|
changed = True
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue