summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/network/fortimanager
diff options
context:
space:
mode:
authorFortinet Core CSE NA <43451990+ftntcorecse@users.noreply.github.com>2019-08-22 03:23:43 -0700
committerNilashish Chakraborty <nilashishchakraborty8@gmail.com>2019-08-22 15:53:43 +0530
commit45cc29ba08b1702ed6c46efd68c95c6d9363b0c3 (patch)
tree0e86379799f51bfa7c3060fa43001e2b8f344e2d /lib/ansible/modules/network/fortimanager
parent55d1da08b11a4223da49851b808a48993ffe4ac2 (diff)
downloadansible-45cc29ba08b1702ed6c46efd68c95c6d9363b0c3.tar.gz
PR Commit for fmgr_device_provision_template. Contains bug fixes. (#58151)
Diffstat (limited to 'lib/ansible/modules/network/fortimanager')
-rw-r--r--lib/ansible/modules/network/fortimanager/fmgr_device_provision_template.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/ansible/modules/network/fortimanager/fmgr_device_provision_template.py b/lib/ansible/modules/network/fortimanager/fmgr_device_provision_template.py
index 8e40115691..3f3d333832 100644
--- a/lib/ansible/modules/network/fortimanager/fmgr_device_provision_template.py
+++ b/lib/ansible/modules/network/fortimanager/fmgr_device_provision_template.py
@@ -66,7 +66,7 @@ options:
provision_targets:
description:
- - The friendly names of devices in FortiManager to assign the provisioning template to. Comma separated list.
+ - The friendly names of devices in FortiManager to assign the provisioning template to. CSV separated list.
required: True
snmp_status:
@@ -686,9 +686,9 @@ def set_devprof_scope(fmgr, paramgram):
}
targets = []
- for target in paramgram["provision_targets"].strip().split(","):
+ for target in paramgram["provision_targets"].split(","):
# split the host on the space to get the mask out
- new_target = {"name": target}
+ new_target = {"name": target.strip()}
targets.append(new_target)
datagram["scope member"] = targets
@@ -1184,14 +1184,14 @@ def set_devprof_faz(fmgr, paramgram):
response = DEFAULT_RESULT_OBJ
datagram = {
"target-ip": paramgram["admin_fortianalyzer_target"],
- "target": 4,
+ "target": "others",
}
url = "/pm/config/adom/{adom}" \
"/devprof/{provisioning_template}" \
"/device/profile/fortianalyzer".format(adom=adom,
provisioning_template=paramgram["provisioning_template"])
if paramgram["mode"] == "delete":
- datagram["hastarget"] = "True"
+ datagram["hastarget"] = "False"
response = fmgr.process_request(url, datagram, paramgram["mode"])
return response
@@ -1457,7 +1457,6 @@ def main():
ansible_facts=fmgr.construct_ansible_facts(results, module.params, paramgram))
except Exception as err:
raise FMGBaseException(err)
-
try:
# PROCESS THE ADMIN OPTIONS
if any(v is not None for v in (
@@ -1467,7 +1466,7 @@ def main():
paramgram["admin_gui_theme"])):
results = set_devprof_admin(fmgr, paramgram)
- fmgr.govern_response(module=module, results=results, good_codes=[0],
+ fmgr.govern_response(module=module, results=results, good_codes=[0], stop_on_success=False,
ansible_facts=fmgr.construct_ansible_facts(results, module.params, paramgram))
except Exception as err:
raise FMGBaseException(err)
@@ -1494,7 +1493,7 @@ def main():
paramgram["smtp_source_ipv4"], paramgram["smtp_validate_cert"])):
results = set_devprof_smtp(fmgr, paramgram)
- fmgr.govern_response(module=module, results=results, good_codes=[0],
+ fmgr.govern_response(module=module, results=results, good_codes=[0], stop_on_success=False,
ansible_facts=fmgr.construct_ansible_facts(results, module.params, paramgram))
except Exception as err:
raise FMGBaseException(err)
@@ -1504,7 +1503,7 @@ def main():
if any(v is not None for v in
(paramgram["dns_suffix"], paramgram["dns_primary_ipv4"], paramgram["dns_secondary_ipv4"])):
results = set_devprof_dns(fmgr, paramgram)
- fmgr.govern_response(module=module, results=results, good_codes=[0],
+ fmgr.govern_response(module=module, results=results, good_codes=[0], stop_on_success=False,
ansible_facts=fmgr.construct_ansible_facts(results, module.params, paramgram))
except Exception as err:
raise FMGBaseException(err)
@@ -1514,7 +1513,7 @@ def main():
if paramgram["admin_fortianalyzer_target"] is not None:
results = set_devprof_faz(fmgr, paramgram)
- fmgr.govern_response(module=module, results=results, good_codes=[0],
+ fmgr.govern_response(module=module, results=results, good_codes=[0], stop_on_success=False,
ansible_facts=fmgr.construct_ansible_facts(results, module.params, paramgram))
except Exception as err:
raise FMGBaseException(err)
@@ -1524,7 +1523,7 @@ def main():
if paramgram["provision_targets"] is not None:
if paramgram["mode"] != "delete":
results = set_devprof_scope(fmgr, paramgram)
- fmgr.govern_response(module=module, results=results, good_codes=[0],
+ fmgr.govern_response(module=module, results=results, good_codes=[0], stop_on_success=False,
ansible_facts=fmgr.construct_ansible_facts(results, module.params, paramgram))
if paramgram["mode"] == "delete":