<?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 error while calculating Next Volume Name in Python Discussions</title>
    <link>https://community.netapp.com/t5/Python-Discussions/Ansible-Playbook-error-while-calculating-Next-Volume-Name/m-p/167688#M59</link>
    <description>&lt;P&gt;I have been able to complete this with help of Netapp colleagues in Slack.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jun 2021 10:59:16 GMT</pubDate>
    <dc:creator>raj_shrivastava11</dc:creator>
    <dc:date>2021-06-11T10:59:16Z</dc:date>
    <item>
      <title>Ansible Playbook error while calculating Next Volume Name</title>
      <link>https://community.netapp.com/t5/Python-Discussions/Ansible-Playbook-error-while-calculating-Next-Volume-Name/m-p/167389#M58</link>
      <description>&lt;P&gt;Hi, I have a below playbook wherein i am using gather info to get volumes and trying to get latest volume using Creation_time but it seems its not able to pick the volume with last creation time. Below is a playbook and error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error is coming while calculating QOS Policy name which like &amp;lt;vol_name&amp;gt;-premium.&amp;nbsp; Error is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fatal: [localhost]: FAILED! =&amp;gt; {&lt;BR /&gt;"msg": "An unhandled exception occurred while templating '{{ vol_name }}-premium'. Error was a &amp;lt;class 'ansible.errors.AnsibleError'&amp;gt;, original message: An unhandled exception occurred while templating '{{ vol_name }}'. Error was a &amp;lt;class 'ansible.errors.AnsibleError'&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Playbook:&lt;/P&gt;&lt;P&gt;---&lt;BR /&gt;- hosts: localhost&lt;BR /&gt;collections:&lt;BR /&gt;- netapp.ontap&lt;BR /&gt;name: Datastore Creation&lt;BR /&gt;vars:&lt;BR /&gt;hostname: 10.220.58.171&lt;BR /&gt;username: admin&lt;BR /&gt;password: veritas123&lt;BR /&gt;vserver: segotx9015&lt;BR /&gt;aggr: segotx910_n1_aggr1&lt;BR /&gt;vol_name: "{{ vol_name }}"&lt;BR /&gt;time: []&lt;BR /&gt;qtree_name: segot_a2_x9015v0037&lt;BR /&gt;qos_policy: "{{ vol_name }}-premium"&lt;BR /&gt;snapshot_policy: "default"&lt;BR /&gt;disk_limit: 4&lt;BR /&gt;tasks:&lt;BR /&gt;- name: Limit Info Gathering to Volume and Lun Information&lt;BR /&gt;na_ontap_info:&lt;BR /&gt;state: info&lt;BR /&gt;gather_subset: "volume_info"&lt;BR /&gt;hostname: "{{ hostname }}"&lt;BR /&gt;username: "{{ username }}"&lt;BR /&gt;password: "{{ password }}"&lt;BR /&gt;https: true&lt;BR /&gt;validate_certs: false&lt;BR /&gt;register: ontap&lt;BR /&gt;- name: Using set_fact&lt;BR /&gt;set_fact:&lt;BR /&gt;time: "{{ time }} + ['{{ ontap.ontap_info.volume_info[item].volume_id_attributes.creation_time }}' ]"&lt;BR /&gt;loop: "{{ ontap.ontap_info.volume_info }}"&lt;BR /&gt;set_fact:&lt;BR /&gt;newest: "{{ time|max }}"&lt;BR /&gt;vol_name: "{{ ontap.ontap_info.volume_info[item].volume_id_attributes.name }}"&lt;BR /&gt;with_items: "{{ ontap.ontap_info.volume_info }}"&lt;BR /&gt;when:&lt;BR /&gt;- ontap.ontap_info.volume_info[item].volume_id_attributes.creation_time == "newest"&lt;BR /&gt;- name: Create Qos Policy Group&lt;BR /&gt;na_ontap_qos_policy_group:&lt;BR /&gt;state: present&lt;BR /&gt;name: "{{ qos_policy }}"&lt;BR /&gt;vserver: "{{ vserver }}"&lt;BR /&gt;max_throughput: 240MB/s&lt;BR /&gt;min_throughput:&lt;BR /&gt;hostname: "{{ hostname }}"&lt;BR /&gt;username: "{{ username }}"&lt;BR /&gt;password: "{{ password }}"&lt;BR /&gt;- name: Create Primary Volume&lt;BR /&gt;na_ontap_volume:&lt;BR /&gt;state: present&lt;BR /&gt;name: "{{ vol_name }}"&lt;BR /&gt;vserver: "{{ vserver }}"&lt;BR /&gt;aggregate_name: "{{ aggr }}"&lt;BR /&gt;size: "{{ disk_limit + 1 }}"&lt;BR /&gt;size_unit: tb&lt;BR /&gt;policy: default&lt;BR /&gt;volume_security_style: unix&lt;BR /&gt;junction_path: "/{{ vol_name }}"&lt;BR /&gt;qos_policy_group: "{{ qos_policy }}"&lt;BR /&gt;snapshot_policy: "{{ snapshot_policy }}"&lt;BR /&gt;hostname: "{{ hostname }}"&lt;BR /&gt;username: "{{ username }}"&lt;BR /&gt;password: "{{ password }}"&lt;BR /&gt;https: true&lt;BR /&gt;validate_certs: false&lt;BR /&gt;- name: Create Export Policy&lt;BR /&gt;na_ontap_export_policy:&lt;BR /&gt;state: present&lt;BR /&gt;name: "{{ qtree_name }}"&lt;BR /&gt;vserver: "{{ vserver }}"&lt;BR /&gt;hostname: "{{ hostname }}"&lt;BR /&gt;username: "{{ username }}"&lt;BR /&gt;password: "{{ password }}"&lt;BR /&gt;https: true&lt;BR /&gt;validate_certs: false&lt;BR /&gt;- name: Create ExportPolicyRule&lt;BR /&gt;na_ontap_export_policy_rule:&lt;BR /&gt;state: present&lt;BR /&gt;name: "{{ qtree_name }}"&lt;BR /&gt;vserver: "{{ vserver }}"&lt;BR /&gt;client_match: 10.221.102.64/26,10.221.102.0/26&lt;BR /&gt;ro_rule: sys&lt;BR /&gt;rw_rule: sys&lt;BR /&gt;protocol: nfs&lt;BR /&gt;super_user_security: any&lt;BR /&gt;allow_suid: true&lt;BR /&gt;hostname: "{{ hostname }}"&lt;BR /&gt;username: "{{ username }}"&lt;BR /&gt;password: "{{ password }}"&lt;BR /&gt;https: true&lt;BR /&gt;validate_certs: false&lt;BR /&gt;- name: Create Qtrees&lt;BR /&gt;na_ontap_qtree:&lt;BR /&gt;state: present&lt;BR /&gt;name: "{{ qtree_name }}"&lt;BR /&gt;flexvol_name: "{{ vol_name }}"&lt;BR /&gt;vserver: "{{ vserver }}"&lt;BR /&gt;export_policy: "{{ qtree_name }}"&lt;BR /&gt;hostname: "{{ hostname }}"&lt;BR /&gt;username: "{{ username }}"&lt;BR /&gt;password: "{{ password }}"&lt;BR /&gt;https: true&lt;BR /&gt;validate_certs: false&lt;BR /&gt;- name: Add/Set quota&lt;BR /&gt;na_ontap_quotas:&lt;BR /&gt;state: present&lt;BR /&gt;vserver: "{{ vserver }}"&lt;BR /&gt;volume: "{{ vol_name }}"&lt;BR /&gt;quota_target: "/vol/{{ vol_name }}/{{ qtree_name }}"&lt;BR /&gt;type: tree&lt;BR /&gt;policy: default&lt;BR /&gt;disk_limit: "{{ disk_limit*1024*1024*1024 }}"&lt;BR /&gt;set_quota_status: True&lt;BR /&gt;hostname: "{{ hostname }}"&lt;BR /&gt;username: "{{ username }}"&lt;BR /&gt;password: "{{ password }}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 10:22:56 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Python-Discussions/Ansible-Playbook-error-while-calculating-Next-Volume-Name/m-p/167389#M58</guid>
      <dc:creator>raj_shrivastava11</dc:creator>
      <dc:date>2025-06-04T10:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible Playbook error while calculating Next Volume Name</title>
      <link>https://community.netapp.com/t5/Python-Discussions/Ansible-Playbook-error-while-calculating-Next-Volume-Name/m-p/167688#M59</link>
      <description>&lt;P&gt;I have been able to complete this with help of Netapp colleagues in Slack.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 10:59:16 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Python-Discussions/Ansible-Playbook-error-while-calculating-Next-Volume-Name/m-p/167688#M59</guid>
      <dc:creator>raj_shrivastava11</dc:creator>
      <dc:date>2021-06-11T10:59:16Z</dc:date>
    </item>
  </channel>
</rss>

