Getting Started with NetApp and Ansible: Updating NetApp Modules

Automation and Configuration Management are indispensable to an efficient DevOps driven environment. NetApp has supported Ansible modules for ONTAP and Element software.  So, let’s get right to it and see how all this works!

Update NetApp Modules

Occasionally, there will be updates to the NetApp modules ahead of the full releases of Ansible. These updates can be bug fixes, new modules, new features, etc.  I know you are going to want to take advantage of these new modules as soon as possible, so here is how to update to the newest options from NetApp.

As usual, I am using CentOS 7.5 for my environment.

The first thing that is needed is an application called ‘git’.  Git is a distributed version control and Source Code Management (SCM) utility.

Once that is installed it is used to download the most current development version of Ansible from the official Ansible Github repo.  I like to download mine to my home directory, but you can put yours where ever you want.

This created a directory called ‘ansible-devel’ in my home directory that contains all the current files for the next version of Ansible.  If I keep this directory, git allows me to use it in a special way that will allow me to automatically download only updated files in the future. This is done with a git pull as in the example.

Whether this was the first time we downloaded the files with a clone, or we just updated with a pull, we need to copy these files to our Ansible modules directory.  You find your environments directory using the ansible --version command.

Line 5 above is the important one.  It says ‘ansible python module location = /usr/lib/python2.7/site-packages/ansible’. Your line may be slightly different based on the distribution of Linux.  The /usr/lib/python2.7/site-packages/ansible directory is where the two important directories we will copy files into are located.  These directories are called ‘module_utils’ and ‘modules’.  The new modules will be copied into these locations. In the example below, be sure to use the path that is after your ‘ansible python module location’.

This will copy all modules and their utilities to your environments working directory for Ansible modules.

That’s it, you just updated your modules between major Ansible releases.  If there has been a major release and you followed the Getting Started guide you can update with this command.

Join me next Getting Started, to learn the basics about playbooks.

If you have any questions or comments join me on our Slack workspace in the #configurationmgmt channel. Also, keep an eye on netapp.io for all new information on what we are doing around Ansible.

You can see a video demonstration of these steps here.

Part 1. Install Ansible
Part 2. Update NetApp Modules
Part 3. Understanding Playbooks
Part 4. First Playbook Example
Part 5. Complete Workflow

David Blackwell on Linkedin
David Blackwell
Technical Marketing Engineer for OpenStack 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. Currently he is the Technical Marketing Engineer for OpenStack at NetApp. When not working, or tinkering with new software at home, David spends most of his free time on his hobby of 3D printing.

Leave a Reply