<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Authentication issue to Palo Alto Panorama from Ansible in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/authentication-issue-to-palo-alto-panorama-from-ansible/m-p/517069#M3198</link>
    <description>&lt;P&gt;Just followed some examples from &lt;A href="https://paloaltonetworks.github.io/pan-os-ansible/" target="_blank"&gt;https://paloaltonetworks.github.io/pan-os-ansible/&lt;/A&gt; and &lt;A href="https://github.com/PaloAltoNetworks/ansible-playbooks/" target="_blank"&gt;https://github.com/PaloAltoNetworks/ansible-playbooks/&lt;/A&gt; to write my first playbook. The target system is a virtual Panorama instance on AWS (software version 10.1.6-h6)&lt;BR /&gt;The playbook is just to show system info:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merlintong_0-1665122126484.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/44451i12FAE22D1FE02B2C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="merlintong_0-1665122126484.png" alt="merlintong_0-1665122126484.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made sure the host inventory has been defined correctly, and both ansible galaxy role and python pan-os sdk are installed. Executing the playbook however throws me a 403 Invalid Credential error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merlintong_1-1665122126489.png" style="width: 891px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/44450i49D4B0E9163E8D36/image-dimensions/891x112/is-moderation-mode/true?v=v2" width="891" height="112" role="button" title="merlintong_1-1665122126489.png" alt="merlintong_1-1665122126489.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple curl test with the same target and API key however works fine:&lt;/P&gt;&lt;P&gt;curl -k '&lt;A href="https://hostname/api/?type=op&amp;amp;cmd=" target="_blank"&gt;https://hostname/api/?type=op&amp;amp;cmd=&lt;/A&gt;&amp;lt;show&amp;gt;&amp;lt;system&amp;gt;&amp;lt;info&amp;gt;&amp;lt;/info&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/show&amp;gt;&amp;amp;key=xxx'&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merlintong_2-1665122126491.png" style="width: 645px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/44449i80FC5F18ED01624C/image-dimensions/645x115/is-moderation-mode/true?v=v2" width="645" height="115" role="button" title="merlintong_2-1665122126491.png" alt="merlintong_2-1665122126491.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing something obvious?&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 05:57:51 GMT</pubDate>
    <dc:creator>merlintong</dc:creator>
    <dc:date>2022-10-07T05:57:51Z</dc:date>
    <item>
      <title>Authentication issue to Palo Alto Panorama from Ansible</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/authentication-issue-to-palo-alto-panorama-from-ansible/m-p/517069#M3198</link>
      <description>&lt;P&gt;Just followed some examples from &lt;A href="https://paloaltonetworks.github.io/pan-os-ansible/" target="_blank"&gt;https://paloaltonetworks.github.io/pan-os-ansible/&lt;/A&gt; and &lt;A href="https://github.com/PaloAltoNetworks/ansible-playbooks/" target="_blank"&gt;https://github.com/PaloAltoNetworks/ansible-playbooks/&lt;/A&gt; to write my first playbook. The target system is a virtual Panorama instance on AWS (software version 10.1.6-h6)&lt;BR /&gt;The playbook is just to show system info:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merlintong_0-1665122126484.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/44451i12FAE22D1FE02B2C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="merlintong_0-1665122126484.png" alt="merlintong_0-1665122126484.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made sure the host inventory has been defined correctly, and both ansible galaxy role and python pan-os sdk are installed. Executing the playbook however throws me a 403 Invalid Credential error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merlintong_1-1665122126489.png" style="width: 891px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/44450i49D4B0E9163E8D36/image-dimensions/891x112/is-moderation-mode/true?v=v2" width="891" height="112" role="button" title="merlintong_1-1665122126489.png" alt="merlintong_1-1665122126489.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple curl test with the same target and API key however works fine:&lt;/P&gt;&lt;P&gt;curl -k '&lt;A href="https://hostname/api/?type=op&amp;amp;cmd=" target="_blank"&gt;https://hostname/api/?type=op&amp;amp;cmd=&lt;/A&gt;&amp;lt;show&amp;gt;&amp;lt;system&amp;gt;&amp;lt;info&amp;gt;&amp;lt;/info&amp;gt;&amp;lt;/system&amp;gt;&amp;lt;/show&amp;gt;&amp;amp;key=xxx'&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="merlintong_2-1665122126491.png" style="width: 645px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/44449i80FC5F18ED01624C/image-dimensions/645x115/is-moderation-mode/true?v=v2" width="645" height="115" role="button" title="merlintong_2-1665122126491.png" alt="merlintong_2-1665122126491.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I missing something obvious?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 05:57:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/authentication-issue-to-palo-alto-panorama-from-ansible/m-p/517069#M3198</guid>
      <dc:creator>merlintong</dc:creator>
      <dc:date>2022-10-07T05:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication issue to Palo Alto Panorama from Ansible</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/authentication-issue-to-palo-alto-panorama-from-ansible/m-p/517103#M3199</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/242326"&gt;@merlintong&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I replicated your playbook and could not replicate the error with a VM-Series on&amp;nbsp;&lt;SPAN&gt;10.1.6-h6.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Have you definitely got the inventory setup correctly? Even Wireshark/tcpdump on your Ansible machine to check it is talking to the correct target VM-Series? Can you see the failed login in the System Logs in PAN-OS? Is there anything going on with the format of the api_key variable variable string which we maybe can't see due to the redacted screenshot)? Does it work if you use username/password instead of the API key?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;---
- name: Test Playbook
  hosts: '{{ target | default("host_vm-series-a") }}'
  gather_facts: false
  connection: local

  collections:
    - paloaltonetworks.panos

  vars:
    device:
      ip_address: "{{ ip_address }}"
      api_key: "{{ api_key | default(omit) }}"

  tasks:
    - name: show system info
      panos_op:
        provider: "{{ device }}"
        cmd: 'show system info'



LAY [host_vm-series-a] *************************************************************************************************************************************************************

TASK [show system info] *************************************************************************************************************************************************************
ok: [host_vm-series-a]

PLAY RECAP **************************************************************************************************************************************************************************
host_vm-series-a           : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 11:24:28 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/authentication-issue-to-palo-alto-panorama-from-ansible/m-p/517103#M3199</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-10-07T11:24:28Z</dc:date>
    </item>
  </channel>
</rss>

