Start a Conversation

Solved!

Go to Solution

4402

July 20th, 2021 09:00

Isilon / Ansible / No module named 'ansible.module_utils.storage.dell'

Hey folks,

I've been trying to test Dell Ansible modules against my Isilon Simulator using the following documentation:

  1. Product guide: Ansible Modules for Dell EMC Isilon v 1.1
  2. FAQ: Ansible Module for Dell EMC Isilon - Dell Community

And I faced with the next error trying to run playbooks/flo_test.yml:

TASK [Get nodes of the Isilon cluster] *********************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'ansible.module_utils.storage.dell'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/morty/.ansible/tmp/ansible-tmp-1626795943.048041-5372-267858379548902/AnsiballZ_dellemc_isilon_gatherfacts.py\", line 100, in \n _ansiballz_main()\n File \"/home/morty/.ansible/tmp/ansible-tmp-1626795943.048041-5372-267858379548902/AnsiballZ_dellemc_isilon_gatherfacts.py\", line 92, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/morty/.ansible/tmp/ansible-tmp-1626795943.048041-5372-267858379548902/AnsiballZ_dellemc_isilon_gatherfacts.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.dellemc_isilon_gatherfacts', init_globals=dict(_module_fqn='ansible.modules.dellemc_isilon_gatherfacts', _modlib_path=modlib_path),\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_dellemc_isilon_gatherfacts_payload_9uuw76x6/ansible_dellemc_isilon_gatherfacts_payload.zip/ansible/modules/dellemc_isilon_gatherfacts.py\", line 133, in \nModuleNotFoundError: No module named 'ansible.module_utils.storage.dell'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Any ideas how to troubleshoot this?

 

Best regards,

Nik

July 29th, 2021 09:00

Oh gosh, I finally did it. Appreciate your help Bryan, but it looks like the galaxy is against me. The product guide recommendations ended up working for me.

It took a bit longer than I expected. The original error was related to insufficient privileges for the command 'ansible-playbook /home/playbooks/flo_test.yml' 

Applying the same command with 'sudo' solves it (not sure if it safe to run this command with sudo though)

But after that I faced with another issue that looked like:

TASK [Get nodes of the Isilon cluster] *********************************************************************************fatal: [localhost]: FAILED! => {"changed": false, "msg": "********nsible modules for Isilon require the Isilon python library to be installed. Please install the library before using these modules."}

And that was related to the fact that I installed isi-sdk-8-1-1 for only the current user. I solved it with uninstalling and installing it back with 'sudo':  sudo pip install isi-sdk-8-1-1 (again there might be a better way to do it, but I was too exhausted to look for it with the 3days freaking module installation experience).

For anyone who is as dummy in Linux as myself and just want to test the module there is the full sequence of commands:

sudo apt install python3-pip
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
sudo pip install isi-sdk-8-1-1
sudo mkdir -p /home/isilonmodules
sudo git clone https://github.com/dell/ansible-isilon.git /home/isilonmodules
##to find the location where you need to create the following directories use 'ansible --version' command
##morty@M:~$ ansible --version
##ansible 2.9.6
## config file = /etc/ansible/ansible.cfg
## configured module search path = ['/home/morty/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
## ansible python module location = /usr/lib/python3/dist-packages/ansible
## executable location = /usr/bin/ansible
## python version = 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0]
sudo mkdir /usr/lib/python3/dist-packages/ansible/modules/storage/dellemc
sudo mkdir /usr/lib/python3/dist-packages/ansible/module_utils/storage/dell/
sudo cp -a /home/isilonmodules/dellemc_ansible/utils/. /usr/lib/python3/dist-packages/ansible/module_utils/storage/dell/
sudo cp -a /home/isilonmodules/dellemc_ansible/isilon/library/. /usr/lib/python3/dist-packages/ansible/modules/storage/dellemc
sudo cp -a /home/isilonmodules/dellemc_ansible/doc_fragments/dellemc_isilon.py /usr/lib/python3/dist-packages/ansible/plugins/doc_fragments/
sudo ansible-playbook /home/playbooks/flo_test.yml

1 Rookie

 • 

72 Posts

July 21st, 2021 10:00

Hi Nik,

Looks like Ansible can't find one of the necessary module files.  Perhaps it wasn't copied or copied to the wrong folder.

I would recommend using "ansible-galaxy collection install dellemc.isilon" it is super simple and reliably installs the module components in my experience.

https://galaxy.ansible.com/dellemc/isilon

Thanks
Bryan

July 26th, 2021 08:00

Hey Bryan,

Thanks for your advise. It definitely easier way to install the module, but it still doesn't work for me

How I tested it:

  1. Reset WSL Ubuntu
  2. Installed Ansible
  3. Installed dellemc.isilon with "ansible-galaxy collection install dellemc.isilon

Now when I'm trying to run the playbook I see a new error:

fatal: [localhost]: FAILED! => {"msg": "Could not find imported module support code for dellemc_isilon_gatherfacts. Looked for either dellemc_ansible_isilon_utils.py or dell.py"}

 I also found the following installation recommendations in the dellemc.isilon collection description on the galaxy site:

  • Download the tar build and follow the below command to install the collection anywhere in your system: ansible-galaxy collection install dellemc-isilon-1.1.1.tar.gz -p ./collections

  • Set the environemnt variable: export ANSIBLE_COLLECTIONS_PATHS=$ANSIBLE_COLLECTIONS_PATHS:/collections

But the don't help me much either:

ansible-galaxy collection install dellemc-isilon-1.1.1.tar.gz -p ./collections

Process install dependency map
ERROR! Invalid collection name 'dellemc-isilon-1.1.1.tar.gz', name must be in the format . . Please make sure namespace and collection name contains characters from [a-zA-Z0-9_] only.

And I'm not sure what folder I need to specify in ANSIBLE_COLLECTIONS_PATHS variable. I supposed that it might be the folder with the missing files from the original error: dellemc_ansible_isilon_utils.py or dell.py

I found them there: 

/home/morty/.ansible/collections/ansible_collections/dellemc/isilon/plugins/module_utils/storage/dell/dellemc_ansible_isilon_utils.py

So I tried to specify the following folder in the variable, but it changed nothing, the error is still the same.

export ANSIBLE_COLLECTIONS_PATHS=$ANSIBLE_COLLECTIONS_PATHS:/home/morty/.ansible/collections/

export ANSIBLE_COLLECTIONS_PATHS=$ANSIBLE_COLLECTIONS_PATHS:/home/morty/.ansible/collections/ansible_collections/

1 Rookie

 • 

72 Posts

July 26th, 2021 12:00

Hi Nik,

The helper module that it is looking for is provided by the galaxy collection so I'm not sure why it can't find it.  Did you remove the files from your previous manual installation attempt?  I wonder if it is trying to use those still.

One thing that you could try to start with a clean setup is to use Python virtual environments like this...

# python3 -m venv isilontest
# source ./isilontest/bin/activate
(isilontest)# python3 -m pip install --upgrade pip
(isilontest)# pip install ansible
(isilontest)# pip isi-sdk-8-1-1
(isilontest)# ansible-galaxy collection install dellemc.isilon

Then you could try to run your playbook from that venv.

Good luck
Bryan

No Events found!

Top