<?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 Security rule automation via &amp;quot;panos_security_rule&amp;quot; returned error in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/security-rule-automation-via-quot-panos-security-rule-quot/m-p/545587#M3382</link>
    <description>&lt;P&gt;I am new to Ansible and trying to set up automation for PA security rule via Ansible for customer. We have installed the panos module from Ansible galaxy and the required python libraries like pan-os-python. However, we encountered two issues when we tried to use the panos_security_rule module in our playbook.&lt;BR /&gt;1. If we include the log_setting parameter, the playbook will return error stating "unsupported parameter: log_setting", but from documentation it should not be the case.&lt;BR /&gt;2. if we exclude the log_setting parameter, the playbook will return error stating "hip-profiles unexpected here", but we don't use any hip profile in our case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message screenshot attached. My playbook is something like below.&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- name: PA configs&lt;BR /&gt;hosts: "{{ device_name }}"&lt;BR /&gt;connection: local&lt;BR /&gt;collections:&lt;BR /&gt;- paloaltonetworks.panos&lt;BR /&gt;gather_facts: no&lt;BR /&gt;&lt;BR /&gt;vars:&lt;BR /&gt;date: "{{lookup('pipe','date \"+%Y-%m-%d\"')}}"&lt;BR /&gt;ansible_user: "ansible"&lt;BR /&gt;ansible_password: "password"&lt;BR /&gt;provider:&lt;BR /&gt;ip_address: "{{ansible_host}}"&lt;BR /&gt;username: "{{ansible_user}}"&lt;BR /&gt;password: "{{ansible_password}}"&lt;BR /&gt;&lt;BR /&gt;tasks:&lt;/P&gt;&lt;P&gt;- name: Get REST API Key&lt;BR /&gt;uri:&lt;BR /&gt;validate_certs: no&lt;BR /&gt;url: 'https://{{ ansible_host }}/api/?type=keygen&amp;amp;user={{ ansible_user }}&amp;amp;password={{ ansible_password }}'&lt;BR /&gt;return_content: yes&lt;BR /&gt;method: GET&lt;BR /&gt;register: response_api_key&lt;BR /&gt;&lt;BR /&gt;- name: Read XML response&lt;BR /&gt;xml:&lt;BR /&gt;content: 'text'&lt;BR /&gt;xmlstring: '{{ response_api_key.content }}'&lt;BR /&gt;xpath: '/response/result/key'&lt;BR /&gt;register: api_key&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;- name: Push PA config&lt;BR /&gt;panos_security_rule:&lt;BR /&gt;ip_address: "{{ansible_host}}"&lt;BR /&gt;username: "{{ansible_user}}"&lt;BR /&gt;password: "{{ansible_password}}"&lt;BR /&gt;rule_name: 'Ansible Test Rule'&lt;BR /&gt;source_zone: ['srczone']&lt;BR /&gt;source_ip: ['any']&lt;BR /&gt;destination_zone: ['dstzone']&lt;BR /&gt;destination_ip: ['1.1.1.1']&lt;BR /&gt;application: ['any']&lt;BR /&gt;log_end: true&lt;/P&gt;&lt;P&gt;log_setting: ['syslog profile']&lt;BR /&gt;group_profile: ['Sec_Profile_Grp']&lt;BR /&gt;action: 'allow'&lt;BR /&gt;&lt;BR /&gt;- name: Commit&lt;BR /&gt;panos_commit:&lt;BR /&gt;ip_address: "{{ ansible_host}}"&lt;BR /&gt;username: "{{ ansible_host }}"&lt;BR /&gt;password: "{{ ansible_password }}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help? Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2023 04:43:33 GMT</pubDate>
    <dc:creator>kenchung</dc:creator>
    <dc:date>2023-06-12T04:43:33Z</dc:date>
    <item>
      <title>Security rule automation via "panos_security_rule" returned error</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/security-rule-automation-via-quot-panos-security-rule-quot/m-p/545587#M3382</link>
      <description>&lt;P&gt;I am new to Ansible and trying to set up automation for PA security rule via Ansible for customer. We have installed the panos module from Ansible galaxy and the required python libraries like pan-os-python. However, we encountered two issues when we tried to use the panos_security_rule module in our playbook.&lt;BR /&gt;1. If we include the log_setting parameter, the playbook will return error stating "unsupported parameter: log_setting", but from documentation it should not be the case.&lt;BR /&gt;2. if we exclude the log_setting parameter, the playbook will return error stating "hip-profiles unexpected here", but we don't use any hip profile in our case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message screenshot attached. My playbook is something like below.&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- name: PA configs&lt;BR /&gt;hosts: "{{ device_name }}"&lt;BR /&gt;connection: local&lt;BR /&gt;collections:&lt;BR /&gt;- paloaltonetworks.panos&lt;BR /&gt;gather_facts: no&lt;BR /&gt;&lt;BR /&gt;vars:&lt;BR /&gt;date: "{{lookup('pipe','date \"+%Y-%m-%d\"')}}"&lt;BR /&gt;ansible_user: "ansible"&lt;BR /&gt;ansible_password: "password"&lt;BR /&gt;provider:&lt;BR /&gt;ip_address: "{{ansible_host}}"&lt;BR /&gt;username: "{{ansible_user}}"&lt;BR /&gt;password: "{{ansible_password}}"&lt;BR /&gt;&lt;BR /&gt;tasks:&lt;/P&gt;&lt;P&gt;- name: Get REST API Key&lt;BR /&gt;uri:&lt;BR /&gt;validate_certs: no&lt;BR /&gt;url: 'https://{{ ansible_host }}/api/?type=keygen&amp;amp;user={{ ansible_user }}&amp;amp;password={{ ansible_password }}'&lt;BR /&gt;return_content: yes&lt;BR /&gt;method: GET&lt;BR /&gt;register: response_api_key&lt;BR /&gt;&lt;BR /&gt;- name: Read XML response&lt;BR /&gt;xml:&lt;BR /&gt;content: 'text'&lt;BR /&gt;xmlstring: '{{ response_api_key.content }}'&lt;BR /&gt;xpath: '/response/result/key'&lt;BR /&gt;register: api_key&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;- name: Push PA config&lt;BR /&gt;panos_security_rule:&lt;BR /&gt;ip_address: "{{ansible_host}}"&lt;BR /&gt;username: "{{ansible_user}}"&lt;BR /&gt;password: "{{ansible_password}}"&lt;BR /&gt;rule_name: 'Ansible Test Rule'&lt;BR /&gt;source_zone: ['srczone']&lt;BR /&gt;source_ip: ['any']&lt;BR /&gt;destination_zone: ['dstzone']&lt;BR /&gt;destination_ip: ['1.1.1.1']&lt;BR /&gt;application: ['any']&lt;BR /&gt;log_end: true&lt;/P&gt;&lt;P&gt;log_setting: ['syslog profile']&lt;BR /&gt;group_profile: ['Sec_Profile_Grp']&lt;BR /&gt;action: 'allow'&lt;BR /&gt;&lt;BR /&gt;- name: Commit&lt;BR /&gt;panos_commit:&lt;BR /&gt;ip_address: "{{ ansible_host}}"&lt;BR /&gt;username: "{{ ansible_host }}"&lt;BR /&gt;password: "{{ ansible_password }}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 04:43:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/security-rule-automation-via-quot-panos-security-rule-quot/m-p/545587#M3382</guid>
      <dc:creator>kenchung</dc:creator>
      <dc:date>2023-06-12T04:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Security rule automation via "panos_security_rule" returned error</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/security-rule-automation-via-quot-panos-security-rule-quot/m-p/548862#M3396</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/221814"&gt;@kenchung&lt;/a&gt;&amp;nbsp; have a look at the reference documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://paloaltonetworks.github.io/pan-os-ansible/modules/panos_security_rule_module.html" target="_blank"&gt;https://paloaltonetworks.github.io/pan-os-ansible/modules/panos_security_rule_module.html&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://ansible-pan.readthedocs.io/en/latest/modules/panos_security_rule_module.html" target="_blank"&gt;https://ansible-pan.readthedocs.io/en/latest/modules/panos_security_rule_module.html&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"log_setting" is a string but you put it in brackets which converts it to a list:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;log_setting: ['syslog profile'].&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you want: log_setting: 'syslog profile'&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Same for group profile.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Unsure about the hip profile. There is a note in the documention saying not to use it. Maybe if you set gather facts to yes then version will correct that?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 06:26:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/security-rule-automation-via-quot-panos-security-rule-quot/m-p/548862#M3396</guid>
      <dc:creator>SimonT</dc:creator>
      <dc:date>2023-07-11T06:26:52Z</dc:date>
    </item>
  </channel>
</rss>

