CheckPointAnsibleMgmtCollection icon indicating copy to clipboard operation
CheckPointAnsibleMgmtCollection copied to clipboard

Getting missing header error while using cp_mgmt_run_script

Open chawl505 opened this issue 1 year ago • 1 comments

Version used: 3.2.0 Error Details: {"changed": false, "msg": "Checkpoint device returned error 400 with message {'code': 'generic_err_missing_required_header', 'message': 'Missing header: [X-chkp-sid]'} Failed to discard session with error 400 with message {'code': 'generic_err_missing_required_header', 'message': 'Missing header: [X-chkp-sid]'}"}

Playbook Snippet:

  • name: run-script check_point.mgmt.cp_mgmt_run_script: script: ls -l / script_name: 'Script Example: List files under / dir' targets: - "{{ gw_name }}" vars: ansible_connection: ansible.netcommon.httpapi ansible_httpapi_use_ssl: 'true' ansible_httpapi_validate_certs: 'false' ansible_network_os: check_point.mgmt.checkpoint ansible_user: "{{ mgmt_user }}" ansible_password: "{{ mgmt_password }}" ansible_checkpoint_domain: "{{ domain }}" domain: "{{ hostvars[inventory_hostname].domain }}" delegate_to: checkpoint register: runscript_sc ignore_errors: True

chawl505 avatar Jun 27 '23 18:06 chawl505

Seems like the login failed before running the playbook, try running a different module. Also, what's the purpose of the 'domain' var mentioned? ansible_checkpoint_domain should be enough. Also try running the API login command in the cli to make sure there isn't a problem

chkp-edenbr avatar Jun 28 '23 09:06 chkp-edenbr