[ansible-project] - Unable to run the playbook with new modules for IBM V7000 storage boxes

250 views
Skip to first unread message

miqdad patwa

unread,
Apr 16, 2021, 5:23:05 AM4/16/21
to ansible...@googlegroups.com
Hello Team,

I need to automate my IBM V7000 Storage system and run commands on the same.

On google i found there is a module from Ansible collection: 

Ansible Collection - ibm.spectrum_virtualize


I downloaded it but i am not sure where to install it. As per the instructions i installed it under python module and module-utils under this path.

/usr/lib/python2.7/site-packages/ansible/modules/storage/ibm where existing packages are kept but still when i run the playbook it gives this error.

TASK [Run CLI commands] *************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "Could not find imported module support code for ibm_svcinfo_command.  Looked for either IBMSVCssh.py or ibm_svc_ssh.py"}

Can anyone help me to run this playbook and update me where i need to install the python module.?


miqdad patwa

unread,
Apr 16, 2021, 9:41:37 AM4/16/21
to ansible...@googlegroups.com, akas...@redhat.com
Hello Abhijeet,

Can you please help me on this?

Brian Coca

unread,
Apr 16, 2021, 9:57:19 AM4/16/21
to Ansible Project, Abhijeet Kasurde
`ansible galaxy collection install ....` should take care of the
installation for you, do not move the specific modules to a location
as they require other parts of the collection, install the collection
as a whole.





--
----------
Brian Coca

miqdad patwa

unread,
Apr 16, 2021, 10:25:42 AM4/16/21
to ansible...@googlegroups.com, bc...@redhat.com
Hello Brian,

i did the same and installed using the same command.

ibm]# ansible-galaxy collection install /tmp/ibm-spectrum_virtualize-1.4.0.tar.gz -p /usr/share/ansible/collections/

[WARNING]: Collection at '/usr/share/ansible/collections/ansible_collections/ibm/plugins' does not have a MANIFEST.json file, cannot detect version.

[WARNING]: Collection at '/usr/share/ansible/collections/ansible_collections/ibm/roles' does not have a MANIFEST.json file, cannot detect version.

[WARNING]: Collection at '/usr/share/ansible/collections/ansible_collections/ibm/tests' does not have a MANIFEST.json file, cannot detect version.

[WARNING]: Collection at '/usr/share/ansible/collections/ansible_collections/ibm/docs' does not have a MANIFEST.json file, cannot detect version.

[WARNING]: Collection at '/usr/share/ansible/collections/ansible_collections/ibm/playbooks' does not have a MANIFEST.json file, cannot detect version.

Process install dependency map

Starting collection install process

Installing 'ibm.spectrum_virtualize:1.4.0' to '/usr/share/ansible/collections/ansible_collections/ibm/spectrum_virtualize'

[root@ansible-kartel ibm]# cd /usr/share/ansible/collections/ansible_collections/ibm/spectrum_virtualize

and also i installed the modules:/usr/lib/python2.7/site-packages/ansible/modules/storage/ibm

This is output of ansible version:

ansible 2.9.14

config file = /etc/ansible/ansible.cfg

configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

ansible python module location = /usr/lib/python2.7/site-packages/ansible

executable location = /usr/bin/ansible

python version = 2.7.5 (default, May 3 2017, 07:55:04) [GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]

Not sure where its looking for the modules?

Here is my playbook in which i am using ibm_svc module

[ support]# more v7ktest.yml
---
- name: Using the IBM Spectrum Virtualize collection to create an FC host
hosts: localhost
gather_facts: no
connection: local
vars:
clustername: **************
domain:
username: superuser
password: ************
log_path: tmp/playbook.debug
tasks:
- name: Run CLI commands
register: results
ibm_svcinfo_command:
command: "svcinfo lssystem"
clustername: "{{ clustername }}"
username: "{{ username }}"
password: "{{ password }}"
log_path: /tmp/test.debug

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7cxCpCjdyeEk4Y6sEpw6o4CinCtu9myho49OLV%2BvK-FqA%40mail.gmail.com.

Matt Martz

unread,
Apr 16, 2021, 10:32:54 AM4/16/21
to ansible...@googlegroups.com, bc...@redhat.com
You haven't done anything to tell the play/task to use that collection.

The easiest way is instead of just using `ibm_svcinfo_command:` you use `ibm.spectrum_virtualize.ibm_svcinfo_command:` in your task.



--
Matt Martz
@sivel
sivel.net

miqdad patwa

unread,
Apr 21, 2021, 9:05:54 AM4/21/21
to ansible...@googlegroups.com, ma...@sivel.net, bc...@redhat.com
Hello,

As per the instructions I installed the collection at this path.

[root@ spectrum_virtualize]# ansible-config dump | grep COLLECTIONS_PATH

COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = [u'/usr/share/ansible/collections']

[root@ansible-kartel spectrum_virtualize]# pwd

/usr/share/ansible/collections/ibm/spectrum_virtualize

[root@********spectrum_virtualize]# ls

docs FILES.json LICENSE MANIFEST.json playbooks plugins README.md roles tests

[root@ansible-kartel spectrum_virtualize]#

************************************************

Now as i will use the below playbook  as just a small sample


[root@ support]# more v7knew.yml
---
- hosts: localhost
gather_facts: false
tasks:
- name: Test module
ibm.spectrum_virtualize.ibm_svcinfo_command:
command: svcinfo lssystem
[root@ansible-kartel support]# ansible-playbook -v v7knew.yml
Using /etc/ansible/ansible.cfg as config file
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
ERROR! couldn't resolve module/action 'ibm.spectrum_virtualize.ibm_svcinfo_command'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/devops/ansible/playbooks/support/v7knew.yml': line 5, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

tasks:
- name: Test module
^ here

I get this error :ERROR! couldn't resolve module/action 'ibm.spectrum_virtualize.ibm_svcinfo_command'. This often indicates a misspelling, missing collection, or incorrect module path.

I did whatever you did but still the module is unable to detect.

Can you help on the same?

I am not sure where i am doing wrong?



Reply all
Reply to author
Forward
0 new messages