<?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 Ansible Panos_security_rule &amp;quot;find&amp;quot; option isn't working? in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/256631#M1890</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am testing all PaloAlto's Ansible modules here and I'm keep getting the following error when using "operation: find"&lt;/P&gt;&lt;P&gt;Here is my playbook:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- name: Testing Palo Alto Panorama Panos_Security_rule module&lt;BR /&gt;connection: local&lt;BR /&gt;hosts: panorama&lt;BR /&gt;vars:&lt;BR /&gt;pan_username: palo_ansible&lt;BR /&gt;pan_password: somepasswd&lt;/P&gt;&lt;P&gt;tasks:&lt;BR /&gt;- name: Find a specific security rule&lt;BR /&gt;panos_security_rule:&lt;BR /&gt;ip_address: '1.2.3.4'&lt;BR /&gt;username: '{{ pan_username }}'&lt;BR /&gt;password: '{{ pan_password }}'&lt;BR /&gt;operation: 'find'&lt;BR /&gt;rule_name: 'NTP_permit'&lt;BR /&gt;register: result&lt;/P&gt;&lt;P&gt;- debug: msg='{{result.stdout_lines}}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule 'NTP_permit' not found. Is the name correct?&lt;BR /&gt;&lt;BR /&gt;I already register this new rule and commit all changes. I can delete the same policy without any issues; however, the operation "find" isn't working as recommended here: &lt;A href="http://paloaltonetworks.github.io/ansible-pan/modules/panos_security_rule_module.html" target="_blank"&gt;http://paloaltonetworks.github.io/ansible-pan/modules/panos_security_rule_module.html&lt;/A&gt; or &lt;A href="https://docs.ansible.com/ansible/2.4/panos_security_rule_module.html" target="_blank"&gt;https://docs.ansible.com/ansible/2.4/panos_security_rule_module.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running Ansible core v2.7.8 with Python 2.7.5 and Panorama v8.1.3. Any idea if this option works?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;</description>
    <pubDate>Mon, 08 Apr 2019 18:23:26 GMT</pubDate>
    <dc:creator>RobertNunez</dc:creator>
    <dc:date>2019-04-08T18:23:26Z</dc:date>
    <item>
      <title>Ansible Panos_security_rule "find" option isn't working?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/256631#M1890</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am testing all PaloAlto's Ansible modules here and I'm keep getting the following error when using "operation: find"&lt;/P&gt;&lt;P&gt;Here is my playbook:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- name: Testing Palo Alto Panorama Panos_Security_rule module&lt;BR /&gt;connection: local&lt;BR /&gt;hosts: panorama&lt;BR /&gt;vars:&lt;BR /&gt;pan_username: palo_ansible&lt;BR /&gt;pan_password: somepasswd&lt;/P&gt;&lt;P&gt;tasks:&lt;BR /&gt;- name: Find a specific security rule&lt;BR /&gt;panos_security_rule:&lt;BR /&gt;ip_address: '1.2.3.4'&lt;BR /&gt;username: '{{ pan_username }}'&lt;BR /&gt;password: '{{ pan_password }}'&lt;BR /&gt;operation: 'find'&lt;BR /&gt;rule_name: 'NTP_permit'&lt;BR /&gt;register: result&lt;/P&gt;&lt;P&gt;- debug: msg='{{result.stdout_lines}}'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule 'NTP_permit' not found. Is the name correct?&lt;BR /&gt;&lt;BR /&gt;I already register this new rule and commit all changes. I can delete the same policy without any issues; however, the operation "find" isn't working as recommended here: &lt;A href="http://paloaltonetworks.github.io/ansible-pan/modules/panos_security_rule_module.html" target="_blank"&gt;http://paloaltonetworks.github.io/ansible-pan/modules/panos_security_rule_module.html&lt;/A&gt; or &lt;A href="https://docs.ansible.com/ansible/2.4/panos_security_rule_module.html" target="_blank"&gt;https://docs.ansible.com/ansible/2.4/panos_security_rule_module.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running Ansible core v2.7.8 with Python 2.7.5 and Panorama v8.1.3. Any idea if this option works?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 18:23:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/256631#M1890</guid>
      <dc:creator>RobertNunez</dc:creator>
      <dc:date>2019-04-08T18:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Panos_security_rule "find" option isn't working?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258041#M1902</link>
      <description>&lt;P&gt;Hi Robero,&lt;/P&gt;&lt;P&gt;Mine works fine. can you make yours like this(added&amp;nbsp;&lt;SPAN class="pl-c"&gt;#&lt;/SPAN&gt;&lt;SPAN&gt;state: 'present')&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- name: Testing Palo Alto Panorama Panos_Security_rule module&lt;BR /&gt;connection: local&lt;BR /&gt;hosts: panorama&lt;BR /&gt;vars:&lt;BR /&gt;pan_username: palo_ansible&lt;BR /&gt;pan_password: somepasswd&lt;/P&gt;&lt;P&gt;tasks:&lt;BR /&gt;- name: Find a specific security rule&lt;BR /&gt;panos_security_rule:&lt;BR /&gt;ip_address: '1.2.3.4'&lt;BR /&gt;username: '{{ pan_username }}'&lt;BR /&gt;password: '{{ pan_password }}'&lt;BR /&gt;operation: 'find'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pl-c"&gt;#&lt;/SPAN&gt;&lt;SPAN&gt;state: 'present'&lt;/SPAN&gt;&lt;BR /&gt;rule_name: 'NTP_permit'&lt;BR /&gt;register: result&lt;/P&gt;&lt;P&gt;- debug: msg='{{result.stdout_lines}}'&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 20:24:21 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258041#M1902</guid>
      <dc:creator>ffadhil</dc:creator>
      <dc:date>2019-04-18T20:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Panos_security_rule "find" option isn't working?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258654#M1903</link>
      <description>&lt;P&gt;Hi There!,&lt;/P&gt;&lt;P&gt;Thanks for your reply. I understand the "state" variable is not supported by panos_security_rule module; thus adding or removing this option will not make any difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Per some unknown reason this playbook still reporting the same error and I don't know how to escalate it.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Roberto&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 18:03:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258654#M1903</guid>
      <dc:creator>RobertNunez</dc:creator>
      <dc:date>2019-04-24T18:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Panos_security_rule "find" option isn't working?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258779#M1904</link>
      <description>&lt;P&gt;A few things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't see you pulling in the Ansible role with your playbook.&amp;nbsp; Palo Alto Networks is using Ansible Galaxy roles to distribute the latest versions of the modules, so you should be using that.&amp;nbsp; Here is the link:&amp;nbsp;&amp;nbsp;&lt;A href="https://galaxy.ansible.com/PaloAltoNetworks/paloaltonetworks" target="_blank"&gt;https://galaxy.ansible.com/PaloAltoNetworks/paloaltonetworks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;operation&lt;/CODE&gt; parameter is being removed (from all modules) in favor of &lt;CODE&gt;state&lt;/CODE&gt;, which is more inline with Ansible standards.&amp;nbsp; Having said that, if you are trying to determine, "if I run this kind of traffic, what rule will that match?" then the module you want to use is &lt;CODE&gt;panos_match_rule&lt;/CODE&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 16:48:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258779#M1904</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-04-25T16:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Panos_security_rule "find" option isn't working?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258813#M1905</link>
      <description>&lt;P&gt;Thanks for the information and your help here; however, this isn't working either. When running "panos_match_rule" module I got the following error:&lt;/P&gt;&lt;P&gt;========================&lt;/P&gt;&lt;P&gt;fatal: [mypanorama]: FAILED! =&amp;gt; {&lt;BR /&gt;"changed": false,&lt;BR /&gt;"invocation": {&lt;BR /&gt;"module_args": {&lt;BR /&gt;"api_key": null,&lt;BR /&gt;"application": "ntp",&lt;BR /&gt;"category": null,&lt;BR /&gt;"destination_ip": "any",&lt;BR /&gt;"destination_port": 123,&lt;BR /&gt;"destination_zone": null,&lt;BR /&gt;"ip_address": "1.2.3.4",&lt;BR /&gt;"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",&lt;BR /&gt;"protocol": null,&lt;BR /&gt;"rule_type": "security",&lt;BR /&gt;"source_ip": "any",&lt;BR /&gt;"source_port": null,&lt;BR /&gt;"source_user": null,&lt;BR /&gt;"source_zone": null,&lt;BR /&gt;"to_interface": null,&lt;BR /&gt;"username": "ansiblepan",&lt;BR /&gt;"vsys_id": "vsys3456"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;MSG:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Panorama is not supported.&lt;/P&gt;&lt;P&gt;========================&lt;/P&gt;&lt;P&gt;However!, what I did find out was that "panos_query_rules" works when using the following playbook:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tasks:&lt;BR /&gt;- name: Find a specific security rule&lt;BR /&gt;panos_query_rules:&lt;BR /&gt;ip_address: '{{ firewall_host }}'&lt;BR /&gt;username: '{{ pan_username }}'&lt;BR /&gt;password: '{{ pan_password }}'&lt;BR /&gt;tag_name: 'NTP_permit'&lt;BR /&gt;devicegroup: 'LABGroup'&lt;BR /&gt;register: result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate you guys helped me here. My concern is that the official PAN and Ansible documentation isn't accurate, as you can see in the last example described at &lt;A href="https://docs.ansible.com/ansible/latest/modules/panos_security_rule_module.html" target="_blank" rel="noopener"&gt;https://docs.ansible.com/ansible/latest/modules/panos_security_rule_module.html&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 19:20:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258813#M1905</guid>
      <dc:creator>RobertNunez</dc:creator>
      <dc:date>2019-04-25T19:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Panos_security_rule "find" option isn't working?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258815#M1906</link>
      <description>&lt;P&gt;So, this is part of the confusion that we are trying to handle.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two distinct groups of &lt;CODE&gt;panos_*&lt;/CODE&gt; Ansible modules.&amp;nbsp; The first is what you get when you install Ansible.&amp;nbsp; The second is what you get when you use the Ansible Galaxy role.&amp;nbsp; Your link is the documentation for what you get when you install Ansible.&amp;nbsp; The documentation for the Ansible Galaxy role is located here:&amp;nbsp;&amp;nbsp;&lt;A href="https://paloaltonetworks.github.io/ansible-pan/" target="_blank"&gt;https://paloaltonetworks.github.io/ansible-pan/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 20:04:01 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-panos-security-rule-quot-find-quot-option-isn-t-working/m-p/258815#M1906</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2019-04-25T20:04:01Z</dc:date>
    </item>
  </channel>
</rss>

