AnsweredAssumed Answered

[Ansible] Unable to obtain sid

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

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


My playbook looks like this:

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

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


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

fatal: []: 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.