Ansible has asked us to change the name of one of our modules.  The module ‘na_ontap_gather_facts’ will be known simply as ‘na_ontap_info’ from Ansible release 2.9 and onwards.  The gather_facts version is being deprecated but will still work in the 2.9 release so nothing will break when you upgrade.  However, as you switch to the newer module there are some changes coming that will require edits to any playbooks using the gather_facts module beyond just the module name update.  We work very hard to never require this kind of change, but this one was beyond our control.

So, in addition to changing na_ontap_gather_facts to na_ontap_info, the module no longer auto registers.  In the gather_facts version, the variable ‘ontap_facts’ was automatically created and could be called without registering the output.  Now you will have to explicitly register the output.  Also, the array that is created is now named ontap_info not ontap_facts, so anyplace you reference the output, even if you were already registering the task, will need to be updated.

Here is an example of an existing task with debug output as it currently works with gather_facts, followed by the bolded changes needed to make it work with na_ontap_info

    na_ontap_gather_facts:
      state: info
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      https: "{{ https }}"
      validate_certs: "{{ validate_certs }}"
   debug:
      msg: "{{ ontap_facts.cluster_node_info }}"
    na_ontap_info:
      state: info
      hostname: "{{ hostname }}"
      username: "{{ username }}"
      password: "{{ password }}"
      https: "{{ https }}"
      validate_certs: "{{ validate_certs }}"
    register: netapp
   debug:
      msg: "{{ netapp.ontap_info.cluster_node_info }}"

Not difficult changes but ones you will need to make to all your playbooks.

As always, I and many of our module developers are on Slack to answer any questions you may have.  If you aren’t on Slack yet come join the over 2000 people in our #configurationmgmt channel on our thePub workspace.  You can get an invite at www.netapp.io/slack

David Blackwell on Linkedin
David Blackwell
Technical Marketing Engineer at NetApp
David is a twenty year IT veteran who has been an admin for just about every aspect of a DataCenter at one time or another. When not working, or tinkering with new software at home, David spends most of his free with his four year old son and his lovely wife.

Pin It on Pinterest