AnsweredAssumed Answered

[Ansible] Unable to obtain sid

Question asked by kontad092704f-5725-450b-9b96-ae5c0bbe04aa on Jun 18, 2018
Latest reply on Jun 18, 2018 by kontad092704f-5725-450b-9b96-ae5c0bbe04aa

I'm trying to write a simple ansible play, containing only a login and a logout task, by following the instructions found here: https://github.com/CheckPointSW/cpAnsible .

 

My playbook looks like this:

---
- hosts: "firewalls"
  tasks:
  - name: "login"
    check_point_mgmt:
      command: login
      parameters:
        username: "{{mgmt_user}}"
        password: "{{mgmt_password}}"
        management: "{{mgmt_server}}"
      fingerprint: "{{mgmt_fingerprint}}"
    register: login_response

  - name: "logout"
    check_point_mgmt:
      command: logout
      session-data: "{{login_response}}"

 

The login goes ok, but the logout task fails with the following error:

fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Command 'logout None' failed with error message: Missing header: [X-chkp-sid]. All changes are discarded and the session is invalidated."}

 

It appears I am unable to obtain a session-id, but I have no idea of how to resolve this.

Outcomes