<?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: Ansible playbook to shutdown interface in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/468103#M2942</link>
    <description>&lt;P&gt;Understood. Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 24 Feb 2022 08:14:58 GMT</pubDate>
    <dc:creator>sall13</dc:creator>
    <dc:date>2022-02-24T08:14:58Z</dc:date>
    <item>
      <title>Ansible playbook to shutdown interface</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467493#M2934</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help creating an Ansible playbook that shutdown one of the firewall interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[...]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;collections:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; - paloaltonetworks.panos&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;tasks:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;- name: "Interface down"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; panos_op:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; provider: '{{ provider }}'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd: 'set network interface ethernet ethernet1/1 link-state down'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[...]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But I get this result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;TASK [Interface down] **********************************************************************************&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;fatal: [localhost]: FAILED! =&amp;gt; {"changed": false, "msg": "Failed to run command : set network interface ethernet ethernet1/1 link-state \"down\" : URLError: code: 400 reason: Illegal parameter [request]"}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'm not sure about what is wrong. Maybe I'm not in configuration mode, but I don't know how to put it before the command.&lt;/P&gt;&lt;P&gt;How would be the best way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 14:57:31 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467493#M2934</guid>
      <dc:creator>sall13</dc:creator>
      <dc:date>2022-02-22T14:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible playbook to shutdown interface</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467540#M2935</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/210318"&gt;@sall13&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The &lt;A href="https://paloaltonetworks.github.io/pan-os-ansible/modules/panos_op.html" target="_self"&gt;panos_op module&lt;/A&gt; is only for operational mode (OP) commands, it will not execute configuration mode commands.&lt;/P&gt;
&lt;P&gt;A general purpose module for configuration is&amp;nbsp;&lt;A href="https://paloaltonetworks.github.io/pan-os-ansible/modules/panos_type_cmd.html" target="_self"&gt;panos_type_cmd&lt;/A&gt;, with which you could do something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  tasks:
    - name: test
      panos_type_cmd:
        provider: '{{ provider }}'
        xpath: "/config/devices/entry[@name='localhost.localdomain']/network/interface/ethernet/entry[@name='ethernet1/1']"
        element: "&amp;lt;link-state&amp;gt;down&amp;lt;/link-state&amp;gt;"&lt;/LI-CODE&gt;
&lt;P&gt;Also follow this with a &lt;A href="https://paloaltonetworks.github.io/pan-os-ansible/modules/panos_commit_firewall.html" target="_self"&gt;commit task&lt;/A&gt; to make the change (link down) live.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 16:34:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467540#M2935</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-02-22T16:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible playbook to shutdown interface</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467858#M2939</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;, It looks great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just one more question about this part:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[@name='localhost.localdomain']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it variable? I mean, it depends on something configured in the firewall?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 16:03:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467858#M2939</guid>
      <dc:creator>sall13</dc:creator>
      <dc:date>2022-02-23T16:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible playbook to shutdown interface</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467865#M2940</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/210318"&gt;@sall13&lt;/a&gt;, not really, this is the same on every PAN-OS device so it can stay the same each time on every device you target.&lt;/P&gt;
&lt;P&gt;Hope that helps,&amp;nbsp;&lt;SPAN&gt;click "Accept as Solution" on the post above if so...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Feb 2022 16:16:38 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/467865#M2940</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-02-23T16:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible playbook to shutdown interface</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/468103#M2942</link>
      <description>&lt;P&gt;Understood. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 08:14:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-playbook-to-shutdown-interface/m-p/468103#M2942</guid>
      <dc:creator>sall13</dc:creator>
      <dc:date>2022-02-24T08:14:58Z</dc:date>
    </item>
  </channel>
</rss>

