ops_template.py: Taking care of the JSON src variable (#3313)
* ops_template.py: Taking care of the JSON src variable * ops_template.py: Specify type='str' for src argument to be explicitpull/4420/head
parent
c3ebc84689
commit
fc5ade4020
|
@ -168,7 +168,7 @@ def main():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
src=dict(type='dict'),
|
src=dict(type='str'),
|
||||||
force=dict(default=False, type='bool'),
|
force=dict(default=False, type='bool'),
|
||||||
backup=dict(default=False, type='bool'),
|
backup=dict(default=False, type='bool'),
|
||||||
config=dict(type='dict'),
|
config=dict(type='dict'),
|
||||||
|
@ -180,8 +180,6 @@ def main():
|
||||||
mutually_exclusive=mutually_exclusive,
|
mutually_exclusive=mutually_exclusive,
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
src = module.params['src']
|
|
||||||
|
|
||||||
result = dict(changed=False)
|
result = dict(changed=False)
|
||||||
|
|
||||||
contents = get_config(module)
|
contents = get_config(module)
|
||||||
|
@ -189,6 +187,7 @@ def main():
|
||||||
|
|
||||||
if module.params['transport'] in ['ssh', 'rest']:
|
if module.params['transport'] in ['ssh', 'rest']:
|
||||||
config = contents
|
config = contents
|
||||||
|
src = module.from_json(module.params['src'])
|
||||||
|
|
||||||
changeset = diff(src, config)
|
changeset = diff(src, config)
|
||||||
candidate = merge(changeset, config)
|
candidate = merge(changeset, config)
|
||||||
|
|
Loading…
Reference in New Issue