<?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 Re: Panos_Security_Rule - &amp;quot;msg&amp;quot;: &amp;quot;dictionary requested, could not parse JSON or key=value&amp;quot; in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/panos-security-rule-quot-msg-quot-quot-dictionary-requested/m-p/482267#M3011</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;, many thanks for taking a look at this for me, it is appreciated&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In answer to your questions, its targeting a Panorama, and yes it is been created in certain device groups, and yes they are supposed to be shared&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this working on a NGFW, but when i tried targeting the Pan i started to get this error, the only change I did was add the device_group value to the "add rule" task&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But no matter, thanks for assisting &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2022 08:26:24 GMT</pubDate>
    <dc:creator>scoobyboy</dc:creator>
    <dc:date>2022-04-25T08:26:24Z</dc:date>
    <item>
      <title>Panos_Security_Rule - "msg": "dictionary requested, could not parse JSON or key=value"</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/panos-security-rule-quot-msg-quot-quot-dictionary-requested/m-p/468782#M2953</link>
      <description>&lt;P&gt;Hi, if some one can advise or help, why I am getting this error within Ansible&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating a load of hosts from a csv, creating a object group and then creating a security rule that references that newly created object group as a source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error is&amp;nbsp;&lt;SPAN class=""&gt;"msg": "dictionary requested, could not parse JSON or key=value"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Below is my code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Host creation :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;read-r1-host-csv-file&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;read_csv&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;path&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;Intenet Access - Azure Data Pub-R1-Hosts.csv&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;key&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;hostname&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;register&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;srcr1hosts&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;Create R1 address objects&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;panos_address_object&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;provider&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"{{ palo_provider }}"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;state&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;present&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'{{ item.value.hostname }}'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'{{ item.value.ip}}'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;with_items&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"{{ srcr1hosts.dict | dict2items }}"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;set_fact&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;r1hosts_in_group&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"{{ srcr1hosts.dict | dict2items | map(attribute='key') | list }}"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;add-r1-source-hosts-network-group&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;panos_address_group&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;provider&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"{{ palo_provider }}"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;srcr1group&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;state&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;present&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;static_value&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"{{ r1hosts_in_group }}"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;delegate_to&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;Global&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rule Creation :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;add a rule Internet Access - Azure Databricks pub - ANY-01&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;panos_security_rule&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;provider&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"palo_provider"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;device_group&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"Azure_Perimeter_Prod"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;state&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'present'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;rule_name&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'Internet Access - Azure Databricks pub - ANY-01'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source_zone&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'internet'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;destination_zone&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'azure'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source_ip&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'srcr1group'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;source_user&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'any'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;destination_ip&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'H-***********'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;application&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'ssl'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;group_profile&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'Global-Block-Url'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;log_setting&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;SPAN&gt;'NA_Log_Forward'&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;location&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;before&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;existing_rule&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;before Internet Access - Azure Databricks pub - ANY&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;action&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;'allow'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, any help appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 17:47:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/panos-security-rule-quot-msg-quot-quot-dictionary-requested/m-p/468782#M2953</guid>
      <dc:creator>scoobyboy</dc:creator>
      <dc:date>2022-02-25T17:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Panos_Security_Rule - "msg": "dictionary requested, could not parse JSON or key=value"</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/panos-security-rule-quot-msg-quot-quot-dictionary-requested/m-p/480594#M3006</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/161485"&gt;@scoobyboy&lt;/a&gt;, I started with your tasks and tried to replicate the error, and I could not. There are a few things that I had to tweak along the way to get the playbook working, and hopefully the notes below could help you though?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the &lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;delegate_to&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Global&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;line isn't needed in the address group creation task&lt;/LI&gt;
&lt;LI&gt;the &lt;FONT face="courier new,courier"&gt;group_profile: ['Global-Block-Url']&lt;/FONT&gt;&amp;nbsp;and &lt;FONT face="courier new,courier"&gt;log_setting: ['NA_Log_Forward']&lt;/FONT&gt;&amp;nbsp;lines need just strings instead of arrays of strings, like this: &lt;FONT face="courier new,courier"&gt;group_profile&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;'Global-Block-Url'&lt;/FONT&gt; and&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;log_setting&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;'NA_Log_Forward&lt;/FONT&gt;'&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;the &lt;FONT face="courier new,courier"&gt;device_group: "Azure_Perimeter_Prod"&lt;/FONT&gt; line is placing the rule inside the context of a Device Group, implying targeting a Panorama, I didn't use this line as the previous tasks had no Device Group context so I targeted a NGFW. If you still need help, maybe you could clarify the target and whether the objects are intended to be shared or not, in Device Groups or not, etc&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Here's my working playbook targeting a PA-Series NGFW&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    - name : Read CSV file
      read_csv :
        path : test.csv
        key : hostname
      register : srcr1hosts

    - name : Create address objects
      panos_address_object :
        provider : "{{ palo_provider }}"
        state : present
        name : '{{ item.value.hostname }}'
        value : '{{ item.value.ip}}'
      with_items : "{{ srcr1hosts.dict | dict2items }}"

    - set_fact :
        hosts_in_group : "{{ srcr1hosts.dict | dict2items | map(attribute='key') | list }}"

    - name : Add address objects to address group
      panos_address_group :
        provider : "{{ palo_provider }}"
        name : test_group
        state : present
        static_value : "{{ hosts_in_group }}"
        #delegate_to : Global

    - name : Add a rule
      panos_security_rule :
        provider : "{{ palo_provider }}"
        #device_group : "Azure_Perimeter_Prod"
        state : 'present'
        rule_name : 'Test rule'
        source_zone : [ 'lab_trust' ]
        destination_zone : [ 'lab_untrust' ]
        source_ip : [ 'test_group' ]
        source_user : [ 'any' ]
        destination_ip : [ 'any' ]
        application : [ 'ssl' ]
        group_profile : 'default'
        log_setting : 'test'
        location : before
        existing_rule : 'test'
        action : 'allow'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Apr 2022 20:45:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/panos-security-rule-quot-msg-quot-quot-dictionary-requested/m-p/480594#M3006</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-04-16T20:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Panos_Security_Rule - "msg": "dictionary requested, could not parse JSON or key=value"</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/panos-security-rule-quot-msg-quot-quot-dictionary-requested/m-p/482267#M3011</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;, many thanks for taking a look at this for me, it is appreciated&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In answer to your questions, its targeting a Panorama, and yes it is been created in certain device groups, and yes they are supposed to be shared&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got this working on a NGFW, but when i tried targeting the Pan i started to get this error, the only change I did was add the device_group value to the "add rule" task&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But no matter, thanks for assisting &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 08:26:24 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/panos-security-rule-quot-msg-quot-quot-dictionary-requested/m-p/482267#M3011</guid>
      <dc:creator>scoobyboy</dc:creator>
      <dc:date>2022-04-25T08:26:24Z</dc:date>
    </item>
  </channel>
</rss>

