summaryrefslogtreecommitdiffstats
path: root/roles/lib_yaml_editor/build/ansible/yedit.py
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lib_yaml_editor/build/ansible/yedit.py')
-rw-r--r--roles/lib_yaml_editor/build/ansible/yedit.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/roles/lib_yaml_editor/build/ansible/yedit.py b/roles/lib_yaml_editor/build/ansible/yedit.py
index a4c0d40b3..dab3d6347 100644
--- a/roles/lib_yaml_editor/build/ansible/yedit.py
+++ b/roles/lib_yaml_editor/build/ansible/yedit.py
@@ -45,13 +45,16 @@ def main():
if rval:
rval = yamlfile.put(module.params['key'], value)
+ if rval[0]:
+ yamlfile.write()
module.exit_json(changed=rval[0], results=rval[1], state="present")
if not module.params['content']:
rval = yamlfile.create(module.params['key'], value)
else:
- yamlfile.write()
rval = yamlfile.load()
+ yamlfile.write()
+
module.exit_json(changed=rval[0], results=rval[1], state="present")
module.exit_json(failed=True,