Sample Ansible Playbook: ONTAP NFS Export Provision and Present

Undeniably, Ansible helps you spend less time managing the configuration of your datacenter by grouping tasks together into a single playbook, configurations can be deployed across a variety of systems simply and easily. NetApp’s new and improved Ansible modules for ONTAP allow configuration management and automation of all ONTAP9 systems using Ansible.

NetApp and Ansible make it easier than ever before to create end-to-end workflows covering the entire process of provisioning and consuming storage. Complete application environments can be created and managed from a single playbook. In this example a complete workflow for creating and presenting an NFS export from an ONTAP system to a host is presented.

There are six tasks in this playbook.

  1. Create or verify and export policy

  2. Create or verify export policy rule

  3. Create or verify a volume, which is then junctioned and accessible according to the rules set in the export policy

  4. Create or verify the host fstabline to target hosts fstab file for new export

  5. Create or verify directory for mount location

  6. Mount or verify export volume on target host

 

If you’re curious about all of the options available for the modules used in this playbook, links to the documentation are below:

Documentation for the non-NetApp modules used can be found here.

Ansible makes automation easy

If you want to start using the ONTAP modules, or just learn more about them, instructions for adding the ONTAP modules to an existing Ansible set can be found here and full documentation for the ONTAP modules is here.

Try using the Ansible playbooks to create and consume storage for your application! Or, create storage which implements your best practices: naming conventions, options, etc.

Be sure to check back at netapp.io often to see other examples of our Ansible modules, and if you are not on our Slack channel be sure to get an invite and join us to discuss configuration management, along with all our other developer projects.

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