<?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 Cannot set aggregate interface or subinterface zone in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/464637#M2916</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to update or create an aggregate interface or subinterface with a zone_name parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;PRE&gt;---&lt;BR /&gt;&lt;BR /&gt;- hosts: all&lt;BR /&gt;  name: CONFIGURE NEW AGGREGATE AND SUBINTERFACE IN EXISTING ZONE&lt;BR /&gt;  connection: local&lt;BR /&gt;  gather_facts: False&lt;BR /&gt;&lt;BR /&gt;collections:&lt;BR /&gt;- paloaltonetworks.panos&lt;BR /&gt;&lt;BR /&gt;vars:&lt;BR /&gt;  ansible_python_interpreter: /var/lib/awx/venv/ansible/bin/python3&lt;BR /&gt;&lt;BR /&gt;tasks:&lt;BR /&gt;  - name: Configure aggregate interface&lt;BR /&gt;    panos_aggregate_interface:&lt;BR /&gt;    provider: '{{ provider }}'&lt;BR /&gt;    template: "test"&lt;BR /&gt;    if_name: ae2&lt;BR /&gt;    zone_name: Access&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Whether the interface exists or not, whether the zone already exists or not, whether the interface is already in the target zone or not, I get the following:&lt;/P&gt;&lt;PRE&gt;The full traceback is:&lt;BR /&gt;File "/tmp/ansible_panos_aggregate_interface_payload_m7t77c6e/ansible_panos_aggregate_interface_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/modules/panos_aggregate_interface.py", line 296, in main&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/network.py", line 1063, in set_zone&lt;BR /&gt;zone_name, mode, refresh, update, running_config, return_type&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/network.py", line 393, in set_zone&lt;BR /&gt;mode=mode,&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/base.py", line 1639, in _set_reference&lt;BR /&gt;obj.update(reference_var)&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/base.py", line 702, in update&lt;BR /&gt;retry_on_peer=self.HA_SYNC,&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/base.py", line 3682, in method&lt;BR /&gt;raise the_exception&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; "msg": "Failed setref: layer3 'ae2' is not a valid reference"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try something similar with panos_l3_subinterface, I get the same error (slightly different line number references in the calling code).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Environment is&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;paloaltonetworks.panos collection 2.9.0&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;pan-os-python 1.6.0&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;pandevice 0.14.0&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;ansible 2.9.11&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Python 3.6.8&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Feb 2022 21:35:29 GMT</pubDate>
    <dc:creator>plonergan</dc:creator>
    <dc:date>2022-02-09T21:35:29Z</dc:date>
    <item>
      <title>Cannot set aggregate interface or subinterface zone</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/464637#M2916</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to update or create an aggregate interface or subinterface with a zone_name parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;PRE&gt;---&lt;BR /&gt;&lt;BR /&gt;- hosts: all&lt;BR /&gt;  name: CONFIGURE NEW AGGREGATE AND SUBINTERFACE IN EXISTING ZONE&lt;BR /&gt;  connection: local&lt;BR /&gt;  gather_facts: False&lt;BR /&gt;&lt;BR /&gt;collections:&lt;BR /&gt;- paloaltonetworks.panos&lt;BR /&gt;&lt;BR /&gt;vars:&lt;BR /&gt;  ansible_python_interpreter: /var/lib/awx/venv/ansible/bin/python3&lt;BR /&gt;&lt;BR /&gt;tasks:&lt;BR /&gt;  - name: Configure aggregate interface&lt;BR /&gt;    panos_aggregate_interface:&lt;BR /&gt;    provider: '{{ provider }}'&lt;BR /&gt;    template: "test"&lt;BR /&gt;    if_name: ae2&lt;BR /&gt;    zone_name: Access&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Whether the interface exists or not, whether the zone already exists or not, whether the interface is already in the target zone or not, I get the following:&lt;/P&gt;&lt;PRE&gt;The full traceback is:&lt;BR /&gt;File "/tmp/ansible_panos_aggregate_interface_payload_m7t77c6e/ansible_panos_aggregate_interface_payload.zip/ansible_collections/paloaltonetworks/panos/plugins/modules/panos_aggregate_interface.py", line 296, in main&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/network.py", line 1063, in set_zone&lt;BR /&gt;zone_name, mode, refresh, update, running_config, return_type&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/network.py", line 393, in set_zone&lt;BR /&gt;mode=mode,&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/base.py", line 1639, in _set_reference&lt;BR /&gt;obj.update(reference_var)&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/base.py", line 702, in update&lt;BR /&gt;retry_on_peer=self.HA_SYNC,&lt;BR /&gt;File "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/panos/base.py", line 3682, in method&lt;BR /&gt;raise the_exception&lt;/PRE&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; "msg": "Failed setref: layer3 'ae2' is not a valid reference"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I try something similar with panos_l3_subinterface, I get the same error (slightly different line number references in the calling code).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Environment is&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;paloaltonetworks.panos collection 2.9.0&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;pan-os-python 1.6.0&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;pandevice 0.14.0&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;ansible 2.9.11&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Python 3.6.8&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 21:35:29 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/464637#M2916</guid>
      <dc:creator>plonergan</dc:creator>
      <dc:date>2022-02-09T21:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot set aggregate interface or subinterface zone</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465179#M2920</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/207617"&gt;@plonergan&lt;/a&gt;, I can replicate this, and it is the same in PAN-OS (go to the zone, try to add an aggregate or sub-interface in the &lt;FONT face="courier new,courier"&gt;Interfaces&lt;/FONT&gt; list, they are not in the drop-down list). I'll see if I can investigate this a little more...&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 12:11:37 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465179#M2920</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-02-11T12:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot set aggregate interface or subinterface zone</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465180#M2921</link>
      <description>&lt;P&gt;I got it &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/207617"&gt;@plonergan&lt;/a&gt;...&lt;BR /&gt;The VSYS needs to be included in the task. Without this, the newly created AE will have vsys=null, and will not be "imported" into the correct VSYS in which your zone is defined. Panorama works at a layer of abstraction that needs to be able to cope with all scenarios, including single-VSYS and multi-VSYS. This explains why in both GUI and Ansible the reference was invalid. If you are not working with a multi-VSYS system, just include this in your task as VSYS1 is the default:&lt;/P&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;vsys: "vsys1"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;P&gt;Here's a full example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  tasks:
    - name: Configure aggregate interface
      panos_aggregate_interface:
        provider: '{{ device }}'
        template: "pa-5260-template"
        vsys: "vsys1"
        if_name: ae2
        zone_name: 5260_dmz

    - name: Configure sub-interface
      panos_l3_subinterface:
        provider: '{{ device }}'
        template: "pa-5260-template"
        vsys: "vsys1"
        name: "ae2.3"
        tag: 300
        enable_dhcp: false
        ip: ["10.1.1.1/24"]
        zone_name: "5260_dmz"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 12:34:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465180#M2921</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-02-11T12:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot set aggregate interface or subinterface zone</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465228#M2925</link>
      <description>&lt;P&gt;Jimmy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That fixed the problem - thanks, I've been banging my head against the wall for two weeks on that one.&amp;nbsp; However, I'm still left with two questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Why is the vsys required to set the zone, but not to create the interface, add a comment, vrouter, IP address, etc.?&amp;nbsp; All those worked fine without the vsys parameter.&lt;/P&gt;&lt;P&gt;2) If I try to assign a zone without the vsys parameter, and trigger the error as above, all the other task parameters (comment, vrouter, IP address, etc.) are effective, even though the task fails.&amp;nbsp; Doesn't that violate the Ansible philosophy that tasks should be atomic, and either succeed or be completely backed out?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 15:00:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465228#M2925</guid>
      <dc:creator>plonergan</dc:creator>
      <dc:date>2022-02-11T15:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot set aggregate interface or subinterface zone</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465243#M2926</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/207617"&gt;@plonergan&lt;/a&gt;, the answers lie in PAN-OS configuration schema. The other items are attributes of an interface, whist the zone is not. An interface is an attribute of a zone, which is contained inside a VSYS. We&amp;nbsp;attach (import) an interface to a zone. The task to create an interface has to (under the hood) first create the interface with its IP address and other attributes, then assign that interface to the zone. Hope that helps? (FYI: I've submitted a &lt;A href="https://github.com/PaloAltoNetworks/pan-os-ansible/pull/295/files" target="_self"&gt;change to the docs&lt;/A&gt; to cover this kind of scenario.)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 15:40:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465243#M2926</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-02-11T15:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot set aggregate interface or subinterface zone</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465245#M2927</link>
      <description>&lt;P&gt;Jimmy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The documentation update addresses my follow-up question #1.&amp;nbsp; What about #2, the atomicity of the task?&amp;nbsp; It seems you wouldn't want to leave the interface partially configured if the task fails.&amp;nbsp; At least, I wouldn't want to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 16:02:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/465245#M2927</guid>
      <dc:creator>plonergan</dc:creator>
      <dc:date>2022-02-11T16:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot set aggregate interface or subinterface zone</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/467196#M2933</link>
      <description>&lt;P&gt;Thanks Peter. I understand your comment, and I've raised &lt;A href="https://github.com/PaloAltoNetworks/pan-os-ansible/issues/296" target="_self"&gt;an issue&lt;/A&gt; on the module repo to track improving this in future.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 12:34:40 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/cannot-set-aggregate-interface-or-subinterface-zone/m-p/467196#M2933</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-02-21T12:34:40Z</dc:date>
    </item>
  </channel>
</rss>

