Last reply by 03-23-2022 Unsolved
Start a Discussion
2 Bronze
2 Bronze

PowerStore Rest API Ansible connection module

Hi all,

I'm currently in  the process of implementing Ansible within a soon to be PowerStore environment. By using the modules I noticed that all playbooks are designed to run with "localhost" as destination. 

I understand that the standard REST calls need to be sent from the Ansible host but this makes it impossible to iterate over a number of hosts from the inventory, as it would be done when connecting via SSH. Did I miss something here? 

Has anybody already implemented a HTTPAPI Plugin for the Isilon/Powermax/PowerStore REST API? 

Hope you can help me out. 




Replies (5)
3 Argentum

Hi J,

It should be possible to have a playbook with multiple "plays" each referencing different hosts.  The PowerStore play and associated tasks would have the "hosts: localhost" and "connection: local".... meanwhile another host play could run tasks against a list of hosts that you just provisioned storage too.

Here are some links to Ansible documentation that explains the multiple plays with different hosts list a bit more...



thanks for your reply. I'm abit confused, since i was used to define the group of hosts with  the "hosts:" variable at the beginning of the playbook which references the group of hosts from the inventory. 

If I would nest several plays, would this mean I need to generate a play for each of my storage arrays? 

Even if I would build a custom inventory, wouldn't the connection for the playbook still be localhost and local to connect from the Ansible host to the Storage Array?

So for example if I want to change the syslog server address on all my systems, I usually would just insert the hostsgroup and then use a task to change that. Ansible would connect to the hosts via SSH and iterate the task over all of them. 

You’re right when it comes to embedding all the array details in the playbook. But you can put array details in separate file and include as vars in your playbook. Using this you can include specific array details for each play/module within the same playbook.

2 Bronze
2 Bronze

Ansible modules for storage array will always use localhost and local user, because Modules are wrapper for RESTAPI calls. 
This won’t stop you from having multiple plays in the same playbook executing against custom inventory. You can also use delegate_to or when conditional parameters to decide targets for each task. 

2 Bronze
2 Bronze

how to gather Powers capacity info using Python script 

Top Contributor
Latest Solutions