<?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 problem - The task includes an option with an undefined variable. The error was: 'provid in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314300#M2212</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So does this mean that i need to create a "provider.yml" file on the same folder as my main playbook. I still need to define the ip address and put in the username and password?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i am getting this error after changing it to "collections:" from "roles:"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TASK [Add test pre-rule to panorama] ***********************************************************************************&lt;BR /&gt;fatal: [10.2.3.10]: FAILED! =&amp;gt; {"msg": "The task includes an option with an undefined variable. The error was: 'provider' is undefined\n\nThe error appears to be in '/etc/ansible/testbook2.yml': line 10, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name: Add test pre-rule to panorama\n ^ here\n"}&lt;/P&gt;&lt;P&gt;PLAY RECAP *************************************************************************************************************&lt;BR /&gt;10.2.3.10 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0&lt;/P&gt;</description>
    <pubDate>Wed, 04 Mar 2020 06:18:39 GMT</pubDate>
    <dc:creator>BennyChong</dc:creator>
    <dc:date>2020-03-04T06:18:39Z</dc:date>
    <item>
      <title>Ansible problem - The task includes an option with an undefined variable. The error was: 'provider'</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314073#M2204</link>
      <description>&lt;P&gt;So i am very new to using ansible with Panorama/Palo Alto firewall. I am doing a test on my test lab pano to see if i can push test rule over to panorama. Here is my yml file&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;BR /&gt;&lt;FONT face="courier new,courier"&gt;- name: Create test new rule playbook&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;hosts: all&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;connection: local&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;roles:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;- role: paloaltonetworks.paloaltonetworks&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;tasks:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;- name: Add test pre-rule to panorama&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;panos_security_rule:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;provider: '{{ provider }}'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;rule_name: 'Ansible test 1'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;description: 'An Ansible test pre-rule'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;source_zone: ['Corp']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;destination_zone: ['cs-user']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;source_ip: ['1.2.3.4']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;source_user: ['any']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;destination_ip: ['any']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;category: ['any']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;application: ['any']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;service: ['any']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;hip_profiles: ['any']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;action: 'allow'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;device_group: 'test-group'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;commit: False&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i try to run the playbook this is what i see&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;PLAY [Create test new rule playbook] ***********************************************************************************&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;TASK [Gathering Facts] *************************************************************************************************[DEPRECATION WARNING]: Distribution Ubuntu 18.04 on host 10.2.3.10 should use /usr/bin/python3, but is using&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;the discovered platform python for this host. See&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;A href="https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html" target="_blank" rel="noopener"&gt;https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html&lt;/A&gt; for more information. This feature&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ansible.cfg.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ok: [10.2.3.10]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;TASK [paloaltonetworks.paloaltonetworks : Install pan-python required library] *****************************************changed: [10.2.3.10]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;TASK [paloaltonetworks.paloaltonetworks : Install pandevice required library] ******************************************changed: [10.2.3.10]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;TASK [paloaltonetworks.paloaltonetworks : Install xmltodict required library] ******************************************changed: [10.2.3.10]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;TASK [Add test pre-rule to panorama] ***********************************************************************************fatal: [10.2.3.10]: FAILED! =&amp;gt; {"msg": "The task includes an option with an undefined variable. The error was: 'provider' is undefined\n\nThe error appears to be in '/etc/ansible/testbook2.yml': line 10, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name: Add test pre-rule to panorama\n ^ here\n"}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;PLAY RECAP *************************************************************************************************************10.2.3.10 : ok=4 changed=3 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what could be wrong here? I still don't get the provider setting yet, did i put it wrongly? Also may i ask what does the " provider: '{{ provider }}'" means on the playbook? Is provider some sort of a value i need to add in? I dont get what provider means and what value should i put as i just got this from an example here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also is there some library that i am missing form these?&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Install pan-python required library&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Install pandevice required library&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Install xmltodict required library&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see some example it should be "PIP" wording instead of the 3 above right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 08:52:34 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314073#M2204</guid>
      <dc:creator>BennyChong</dc:creator>
      <dc:date>2020-03-03T08:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible problem - The task includes an option with an undefined variable. The error was: 'provid</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314212#M2205</link>
      <description>&lt;P&gt;&lt;CODE&gt;provider&lt;/CODE&gt; is a param that you're passing in to &lt;CODE&gt;panos_security_rule&lt;/CODE&gt;, while the &lt;CODE&gt;'{{ provider }}'&lt;/CODE&gt; part says, "use the variable "provider" that is somehow being brought into this playbook.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can specify credentials a few different ways:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Load it from a file; this is fine if you're just playing around.&amp;nbsp; Just create another YAML file in the same directory as your playbook and do this, except with real values:&lt;LI-CODE lang="markup"&gt;provider:
  ip_address: '10.1.1.1'
  username: 'admin'
  password: 'secret'​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Get the credentials from Ansible Vault; this is the preferred way if you're using Ansible in production&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just as a side note, the Palo Alto Networks Ansible role is now deprecated in favor of the collection, which is on Ansible Galaxy as paloaltonetworks.panos.&amp;nbsp; The repo for the new collection is &lt;A href="https://github.com/PaloAltoNetworks/pan-os-ansible" target="_self"&gt;here&lt;/A&gt;, and also keep in mind that collections require that you are using Ansible 2.9+.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 17:30:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314212#M2205</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2020-03-03T17:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible problem - The task includes an option with an undefined variable. The error was: 'provid</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314300#M2212</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So does this mean that i need to create a "provider.yml" file on the same folder as my main playbook. I still need to define the ip address and put in the username and password?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i am getting this error after changing it to "collections:" from "roles:"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TASK [Add test pre-rule to panorama] ***********************************************************************************&lt;BR /&gt;fatal: [10.2.3.10]: FAILED! =&amp;gt; {"msg": "The task includes an option with an undefined variable. The error was: 'provider' is undefined\n\nThe error appears to be in '/etc/ansible/testbook2.yml': line 10, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n tasks:\n - name: Add test pre-rule to panorama\n ^ here\n"}&lt;/P&gt;&lt;P&gt;PLAY RECAP *************************************************************************************************************&lt;BR /&gt;10.2.3.10 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 06:18:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314300#M2212</guid>
      <dc:creator>BennyChong</dc:creator>
      <dc:date>2020-03-04T06:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible problem - The task includes an option with an undefined variable. The error was: 'provid</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314421#M2213</link>
      <description>&lt;P&gt;I had the same problem, you can call your provider details in from a script as you described but at the moment I have set my ansible playbook up like this. so i call the the '{{ provider }}' from a variable called provider&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;hosts&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;localhost&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;connection&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;local&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;gather_facts&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;False&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPA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Password!!'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 16:13:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314421#M2213</guid>
      <dc:creator>Martin_King</dc:creator>
      <dc:date>2020-03-04T16:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible problem - The task includes an option with an undefined variable. The error was: 'provid</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314461#M2214</link>
      <description>&lt;P&gt;If you created a file "provider.yml" that has the auth credentials in it, then you just tell Ansible to load that file at the beginning of your "tasks":&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;  tasks:
  - name: Grab auth creds
    include_vars:  'provider.yml'
    no_log: 'yes'&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Mar 2020 17:40:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314461#M2214</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2020-03-04T17:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible problem - The task includes an option with an undefined variable. The error was: 'provid</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314623#M2216</link>
      <description>&lt;P&gt;Okay the VARS works for me now. Thanks for that and now it all make sense.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On another note, what if i have multiple device group on the same pano that i want to add i new rule, take this for example i have "DG1" an "DG2" i want to craete, some how the line below didnt work for me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;device_group: 'DG1' 'DG2'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't i put both device group name on the same task together? Or must this be done on a separate task that specify only single device group?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 07:25:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314623#M2216</guid>
      <dc:creator>BennyChong</dc:creator>
      <dc:date>2020-03-05T07:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible problem - The task includes an option with an undefined variable. The error was: 'provid</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314739#M2218</link>
      <description>&lt;P&gt;You can use standard Ansible looping to do this.&amp;nbsp; You have both Ansible filters and Jinja2 templating functions available to use in playbooks.&amp;nbsp; This blog post shows a little bit of looping and walks through using facts modules to do updates to existing config:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://live.paloaltonetworks.com/t5/Automation-API-Blog/Ansible-Using-Facts-Modules-to-do-Updates/ba-p/275173" target="_blank"&gt;https://live.paloaltonetworks.com/t5/Automation-API-Blog/Ansible-Using-Facts-Modules-to-do-Updates/ba-p/275173&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 17:42:54 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/ansible-problem-the-task-includes-an-option-with-an-undefined/m-p/314739#M2218</guid>
      <dc:creator>gfreeman</dc:creator>
      <dc:date>2020-03-05T17:42:54Z</dc:date>
    </item>
  </channel>
</rss>

