Automate ONTAP Select deployments with Ansible Edit on GitHub Request doc changes

Contributors netapp-barbe dmp-netapp

Use Ansible roles and playbooks to automate ONTAP Select deployments.

An Ansible role is a logical collection of tasks, templates, handlers, and variables in a standardized file structure. Use these roles to facilitate, reuse, and modularize functionality that can be independently used. Include roles, and the list of hosts where you want them to run, in a playbook for execution. After you install Ansible, update the necessary modules, and understand playbooks, you are ready to download ONTAP Select (OTS) roles from NetApp GitHub to create and run your own playbook to deploy ONTAP Select clusters.

Roles

There are two roles available for ONTAP Select:

na_ots_deploy

This role downloads the installation file for ONTAP Select Deploy onto a vCenter or ESXi host. It then creates and runs the Deploy VM.

This role uses the following input values:

  • vCenter or ESXi host credentials

  • Deploy VM creation, including information such as:

    • IP address

    • Host name

    • Login

    • Password

    • Datastore

    • Network

  • Local path to the OVA file

    Make sure the installation file is available before running the playbook including the role).

The simplest way to provide these input values is through a global variables file in YML format. Pass this YML file in the playbook.

The role has a single task that imports the Deploy OVA file onto the host, creates the VM, and runs it. You can access and download this role from the NetApp Ansible GitHub here: na_ots_deploy

na_ots_cluster

This role uses the ONTAP Select Deploy APIs to create and deploy the ONTAP Select cluster. It assumes that the Deploy VM has been created and is up and running either manually or using the na_ots_deploy role. Also, the role assumes that the Select hosts are appropriately configured with the networking and storage required for ONTAP Select cluster.

The role uses the input values for the vCenter or ESXI credentials, and Deploy VM credentials to access the APIs and all the pertaining information required to create the ONTAP Select cluster and the node VM.

The role performs the following tasks:

  • Adding (vcenter or esxi) host credentials

  • Getting and registering the host IDs

  • Validating the internal network (for multi-node clusters)

  • Creating the cluster

  • Configuring the nodes

  • Configuring the network and storage pool

  • Deploying the cluster

As a result, the role completes with the cluster VM up and running and the ONTAP Select cluster fully deployed. You can access and download this role from the NetApp Ansible GitHub here: na_ots_cluster

Example Playbook

The following is an example playbook that calls these two ONTAP Select roles. Note that the input variables are defined in YML files and passed in via “vars_files”. You can find more details in the README files in each of the roles.

—

– name: Create ONTAP Select deploy from OVA (ESXi)

vars_files:

– vars_deploy.yml                              # All Variables

– vars_deploy_pwd.yml                          # host_password & deploy_password

hosts: “{{ target_vcenter_or_esxi_host }}”     # Entry in Ansible ‘hosts’ file

gather_facts: false

connection: ‘local’

roles:

– na_ots_deploy

– name: Create ONTAP Select Cluster

vars_files:

– vars_cluster_test.yml

– vars_cluster_pwd.yml

hosts: “localhost”

gather_facts: false

roles:

– na_ots_cluster

After the ONTAP Select cluster is created and running using the above roles, you can leverage the rich set of ONTAP Ansible roles available to further automate ONTAP features and functionality. The available ONTAP roles can be accessed here. In summary, the ONTAP Select Ansible roles along with ONTAP roles let you fully automate your end-to-end workflow to manage your storage with ONTAP Select.