Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Simon_Macpherso
Advisor

MGMT API with Ansible Checkpoint Modules

Hi,

I'm running a bash script using the cp_mgmt_run_script Ansible module for checkpoint against one remote gateway.

The script runs successfully on the gateway.

Within Smart Console however, the task populates in the recent task list with 40% progress but not not complete. It does not progress and must be manually cleared. 

Is anyone aware of a bug that could be causing this? 

Is there a workaround that could be written in to the playbook or bash script? 

If I run the script vi a POST api call using the run-script module using either mgmt_cli or web services, the task progresses to completion as expected. This indicate Ansible is the cause. 

I will open a TAC case if no one is aware.

Versions:

Mgmt version:  R80.30 GA 210

Gateway version:   R80.30 GA 196

Regards,

Simon

0 Kudos
3 Replies
PhoneBoy
Admin
Admin

Most likely this will require a TAC case.
What's the script?

0 Kudos
Simon_Macpherso
Advisor

Hey

I've tried a couple of bash scripts so it seems it could be a problem with the cp_mgmt_run_script module. 

I've opened a TAC case. 

Regards,

Simon

0 Kudos
Simon_Macpherso
Advisor

The following error is returned in the cli when the playbook is run

 

TASK [run-script] ****************************************************************************************************************

fatal: [10.1.2.51]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": {" code": "generic_err_invalid_parameter", "message": "ERROR: Failed to handle asynchronous tasks as synchronous, tasks result is und efined.\nInvalid parameter for [task-id]. Invalid value"}}

 

An mentioned, the task actually runs successfully against the target gateway.

 

Here is the related information from $FWDIR/log/api.elg

---------------------------

ID: 14684

Response-Code: 400

Content-Type: application/json

Headers: {Content-Type=[application/json], Date=[Thu, 23 Jul 2020 23:57:15 GMT]}

Payload: {

"code" : "generic_err_invalid_parameter",

"message" : "Invalid parameter for [task-id]. Invalid value"

}

--------------------------------------

2020-07-23 23:57:17,419 INFO org.apache.cxf.interceptor.LoggingInInterceptor.log:250 [qtp1325351680-37] - Inbound Message

----------------------------

ID: 14685

Address: http://127.0.0.1:50276/web_api/show-task

Encoding: ISO-8859-1

Http-Method: POST

Content-Type: application/json

Headers: {accept-encoding=[identity], connection=[keep-alive], Content-Length=[114], content-type=[application/json], Host=[127.0.0.1:50276], User-Agent=[Python-urllib/2.7], X-Chkp-Sid=[8b04d47571c316b5c41d763d30263ffe], X-Forwarded-For=[10.1.7.110], X-Forwarded-Host=[10.1.2.51:443], X-Forwarded-Host-Port=[443], X-Forwarded-Server=[10.1.2.51]}

Payload: {"task-id": {"task-id": "01466935-7a42-4478-89bd-d38019364e0b", "target": "26db824a-f9a9-436b-a826-9899f41c8c4e"}}

--------------------------------------

2020-07-23 23:57:17,425 WARN com.checkpoint.management.web_api_is.utils.helpers.RequestHeadersHelper.getMediaType_aroundBody6:9 [qtp1325351680-37] - No Accept header received. Falling back to default media type [application/json].

2020-07-23 23:57:17,426 INFO com.checkpoint.management.web_api_is.utils.helpers.ApiCache.<init>:21 [qtp1325351680-37] - Cache created and initialized

2020-07-23 23:57:17,427 ERROR com.checkpoint.management.web_api_is.utils.jackson.deserializers.BaseMultiValueDeserializer.deserializeSingleObject_aroundBody2:16 [qtp1325351680-37] - Failed to deserialize parameter: [task-id], value is not from type: [java.lang.String]

2020-07-23 23:57:17,427 ERROR com.checkpoint.management.web_api_is.exceptions.WebApiGeneralException.log:42 [qtp1325351680-37] - Error code: [GENERIC_ERR_INVALID_PARAMETER]

2020-07-23 23:57:17,428 ERROR com.checkpoint.management.web_api_is.exceptions.WebApiGeneralException.log:43 [qtp1325351680-37] - Error message: [Invalid parameter for [task-id]. Invalid value]

0 Kudos
Upcoming Events

    CheckMates Events