Updated 4/29/2020
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.
If you don’t want to install Ansible, but do have Docker, you can use the container image that is built weekly to have the most current Ansible and NetApp collections ‘schmots1/netapp-ansible ’. Here is Docker’s getting started guide if you are unfamiliar. Docker Get Started
Part 1. Install Ansible
If you don’t have Ansible already installed, getting it is very easy. There are multiple ways to get Ansible, but I will be focusing on the PIP method. PIP is a python package manager. I will show CentOS 7 and 8 for my examples but with minor changes this will work for any distribution.
For CentOS 7 the pip package is in the EPEL repository, so first you need to install that repo.
$ sudo yum install epel-release -y
Once that is installed it’s a simple matter to add PIP.
$ sudo yum install python-pip -y
For CentOS 8, pip comes with python, but it’s version 3 now.
$ sudo yum install python3 -y
Now that you have PIP installed, we can add Ansible with a single line. (For CentOS 8 ‘pip’ is ‘pip3’ i.e. sudo pip3 install ansible)
$ sudo pip install ansible
The last thing we need from PIP is some NetApp specific python modules.
$ sudo pip install netapp-lib solidfire-sdk-python requests
Finally, you need the NetApp collections and the collections directory to allow all users access
$ sudo ansible-galaxy collection install netapp.ontap netapp.elementsw -p /usr/share/ansible/collections
$ sudo chmod +rx /usr/share/ansible/collections
That’s it, Ansible is now installed and ready to use with ONTAP and Element Software.
Updates are very simple as well.
$ sudo pip install -U ansible
$ sudo ansible-galaxy collection install netapp.ontap netapp.elementsw -p /usr/share/ansible/collections -f
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.
Part 1. Install Ansible
Part 2. Understanding Playbooks
Part 3. First Playbook Example
Part 4. Complete Workflow