Hi
I am trying to run a script on a Firewall running R80.40 from an Ansible playbook, however I'm getting errors. What I did is this:
- I created a test playbook:
---
- name: Check Point test
hosts: all
connection: httpapi
tasks:
- name: Save configuration
cp_mgmt_run_script:
script_name: "Save configuration"
script: clish -c "save config"
wait_for_task: no
targets:
- Standalone-Ansible
If I run this playbook, I get the following output:
PLAY [Check Point test] ****************************************************************************************************************************************************************************
TASK [Gathering Facts] *********************************************************************************************************************************************************************************************
ok: [10.0.18.84]
TASK [Save configuration] ******************************************************************************************************************************************************************************************
changed: [10.0.18.84]
PLAY RECAP *********************************************************************************************************************************************************************************************************
10.0.18.84 : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
So, it seems to work, right? well, not really. If I log into the Check Point Smart Console, I see that the task is still "running" with a 10% completion. And it never finishes or even progresses, I've let it run for two days.
Now, if I change the playbook, specifically this option:
wait_for_task: no
to
wait_for_task: yes
then I get the following output:
PLAY [Check Point test] ****************************************************************************************************************************************************************************
TASK [Gathering Facts] *********************************************************************************************************************************************************************************************
ok: [10.0.18.84]
TASK [Save configuration] ******************************************************************************************************************************************************************************************
fatal: [10.0.18.84]: FAILED! => {"changed": false, "msg": {"code": "generic_err_invalid_parameter", "message": "ERROR: Failed to handle asynchronous tasks as synchronous, tasks result is undefined.\nInvalid parameter for [task-id]. Invalid value"}}
PLAY RECAP *********************************************************************************************************************************************************************************************************
10.0.18.84 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
So, it failed, right? well, the Check Point Smart Console says that the task completed successfully, but since Ansible receives an error, the playbook stops.
Now: how do I solve this? it seems no matter what I do, I get an error somewhere and the script does not work. Thanks in advance for your help