Closed xav-git closed 1 year ago
I can reproduce the issue.
taskid
is returned by FortiManager, but not in the usual data
dict:
{
"id": 6,
"result": [
{
"status": {
"code": 0,
"message": "OK"
},
"taskid": 363,
"url": "sys/hitcount"
}
]
}
fmgr_sys_hitcount
but also fmgr_generic
failed at catching it.
Internal Reference
0870456
Thanks for pointing it out. This problem is fixed in FortiManager Ansible Collection 2.2.0.
You can use r.meta.response_data.task
to get the task id now.
With following ansible code:
tasks:
name: Count_HITCount fmgr_sys_hitcount: bypass_validation: False enable_log: 'true' sys_hitcount: adom: DATA pkg: FW001 register: r
name: Poll the task fmgr_fact: facts: selector: 'task_task' params: task: '{{ r.meta.response_data.task }}' register: taskinfo until: taskinfo.meta.response_data.percent == 100 retries: 30 delay: 5
Error Message: "The task includes an option with an undefined variable. The error was: 'list object' has no attribute 'task' When displaying r we have the same problem.
Expected Behavior: The hitcount command should provide a task id as result to be able to retrieve the result of the hitcount command.