fujitsu / fujitsu-ansible-irmc-integration

The Fujitsu Software Serverview Ansible iRMC Integration features modules and playbooks to access and manage Fujitsu PRIMERGY servers via iRMC.
GNU General Public License v3.0
34 stars 6 forks source link

Error running example related toy import in irmc_facts.p #3

Closed jscott0918 closed 5 years ago

jscott0918 commented 5 years ago

Trying to get started by running a simple get_facts example. I get the following error. I've made sure all of the dependencies are met (pip install future requests urllib3 requests_toolbelt succeeded).

Dump below of error

jscott@scoj-mac-0:fujitsu-ansible-irmc-integration/examples $ ansible-playbook -vvv get_server_facts.yml No config file found; using defaults

PLAYBOOK: get_server_facts.yml ***** 1 plays in get_server_facts.yml

PLAY [get server facts via iRMC] ***

TASK [Get basic server and iRMC facts] ***** task path: /Users/jscott/.ansible/plugins/modules/fujitsu-ansible-irmc-integration/examples/get_server_facts.yml:26 fatal: [spc1]: FAILED! => {"failed": true, "msg": "error importing module in /Users/jscott/.ansible/plugins/modules/fujitsu-ansible-irmc-integration/library/irmc_facts.py, expecting format like 'from ansible.module_utils. import *'"}

NO MORE HOSTS LEFT ***** to retry, use: --limit @get_server_facts.retry

PLAY RECAP ***** spc1 : ok=0 changed=0 unreachable=0 failed=1

akumch commented 5 years ago

Please note the documentation, section Getting Started:

Copy the example playbooks to the main folder and adapt the and the variables in group_vars to your environment and run the playbooks.

It seems you started the playbook directly from the examples folder:

TASK [Get basic server and iRMC facts] ***** task path: /Users/jscott/.ansible/plugins/modules/fujitsu-ansible-irmc-integration/examples/get_server_facts.yml:26

Does the error persist if you copy the playbook into the main folder?

jscott0918 commented 5 years ago

Would the variables in group_vars impact the ability to import libraries? I copied the example playbook to the root and still receive same error.

jscott0918 commented 5 years ago

Yes, the error persists when copying to main folder

akumch commented 5 years ago

I'm at a loss as to what your problem might be. We cannot reproduce it. We tried the package in every constellation of user rights and file system location we could think of and it always worked perfectly.

So now I have to guess:

akumch commented 5 years ago

I'm at a loss as to what your problem might be. We cannot reproduce it. We tried the package in every constellation of user rights and file system location we could think of and it always worked perfectly.

So now I have to guess:

jscott0918 commented 5 years ago

This was failing under RHEL 6.9 and Mac OS 10.13.6 High Sierra. I created a fresh install of RHEL 7.5, installed ansible, pulled the repo, copied the examples to the root directory and everything worked fine. Something is wrong with my python path on my laptop/old workstation so i'm fine closing this issue and i'll just sort it out on my own machines.