Home > Storage > PowerMax and VMAX > Storage Admin > Dell PowerMax: Ansible Modules Best Practices > Getting Started with Ansible Modules
Before writing the body of your playbook, study the Dell documentation for the Ansible modules to understand the functionality of each of the modules. Figure 5 lists the PowerMax modules with the ansible-doc -l dellemc.powermax command.
To view the documentation for any of the listed modules, enter ansible-doc <module name> on your Ansible server, as shown in Figure 6. You must use the full qualified canonical name (FQCN), such as Ansible-doc dellemc.PowerMax.info, to access the documentation.
The help documentation details any parameters required for running tasks with the module. Parameters listed with = are required for running tasks with the module. Optional parameters are indicated with -.
A full list of examples, along with sample code, appears in the EXAMPLES section. To go directly to the examples, press the / key and enter EX. You can copy and reformat the code for your playbooks or adapt it to meet your needs.
Each PowerMax module is multifunctional and designed so that it can be run in an idempotent manner. Reviewing the examples highlights the full range of functions, including an example for each supported and tested function of a module.
Whether you are writing an Ansible task to deploy storage or installing a service on a Linux server, the Ansible module usually has a state parameter with a value that can be set to present or absent.
Setting the state to present assumes the object exists, and the Ansible module will take one of the following actions:
Setting the state to absent tells the Ansible task to delete the object or ignore it if there is no object on the storage array that matches the description.
Best Practice: The PowerMax API is built around the storage group as the management construct. Usually, you can most simply achieve any automation task by using the storage group as the management construct, as shown in the examples that follow. Volume operations, such as volume delete and volume resize, are the exception to this rule; they are handled exclusively in the volume module.
The connection parameters to Unisphere include:
Handle the array credentials carefully, and do not reveal them to all users. Any user who has the array credentials can log in to the Linux host and provision storage using the Ansible modules. Users require administrator privileges to run playbooks that perform provisioning tasks. Users require replication privileges to operate snapshot operations. Authentication can be integrated with LDAP and Role Based Access Control through the Unisphere for PowerMax configuration on a per-array basis.
Best Practice: Create a separate user account for Ansible on Unisphere. Provide the user the required (storage administrator) permissions, granting permission on all arrays to be managed by Ansible. For increased security, employ additional tools for securing passwords. Ansible Vault is one way of securing credentials.