Unsolved
3 Posts
0
1742
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.
Best
J
bmcfeeters
1 Rookie
1 Rookie
•
72 Posts
1
June 26th, 2020 06:00
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...
https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html
https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html
Thanks
Bryan
waghmaredb
10 Posts
1
June 26th, 2020 08:00
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.
Jopaszek2
3 Posts
0
June 29th, 2020 03:00
Hi,
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.
waghmaredb
10 Posts
0
June 30th, 2020 05:00
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.
velu1983
1 Message
0
March 23rd, 2022 06:00
how to gather Powers capacity info using Python script