problem while running role

module_stdout": “\r\nTraceback (most recent call last):\r\n File "/tmp/ansible_dfQNUM/ansible_module_setup.py", line 139, in \r\n main()\r\n File "/tmp/ansible_dfQNUM/ansible_module_setup.py", line 131, in main\r\n data = get_all_facts(module)\r\n File "/tmp/ansible_dfQNUM/ansible_modlib.zip/ansible/module_utils/facts.py", line 4031, in get_all_facts\r\n File "/tmp/ansible_dfQNUM/ansible_modlib.zip/ansible/module_utils/facts.py", line 3974, in ansible_facts\r\n File "/tmp/ansible_dfQNUM/ansible_modlib.zip/ansible/module_utils/facts.py", line 1072, in populate\r\n File "/tmp/ansible_dfQNUM/ansible_modlib.zip/ansible/module_utils/facts.py", line 1605, in get_lvm_facts\r\nIndexError: list index out of range\r\n”, “msg”: “MODULE FAILURE”, “rc”: 0}

– Ashir

Can there be even less information in your message?

I only see one huge line with an error.
I'm guessing you want to get rid of it. If so, then you should provide
much more information:

- what you're trying to do
- playbook/inventory code
- output of "ansible --version"

I just try to run the ansible setup command I get this error, or I preciously can say this error " line 1605, in get_lvm_facts" and ansible version is 2.4.7.
– ashi

I just try to run the ansible setup command I get this error, or I preciously can say this error " line 1605, in get_lvm_facts" and ansible version is 2.4.7.

AFAIK there has never been a version 2.4.7.
Also that is not what I asked.

The output of “ansible --version”

ansible --version
ansible 2.4.0 (devel a06014663c) last updated 2017/04/18 12:36:51 (GMT +000)
config file = /opt/ansible/config/ansible.cfg
configured module search path = [u’/opt/ansible/library’]
ansible python module location = /opt/ansible/lib/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]

Did this archeological setup work before?

Yes!!, it’s worked on many env but gets this error while ansible tries to gather facts on the host.
“line 1605, in get_lvm_facts\r\nIndexError: list index out of range”

–ashir

  1. you may want to upgrade your versions of Ansible - and Python, for that matter.

  2. if it is only happening on a single host, it makes me wonder if LVM is even installed on that host.

  • Rilindo

Ok so this happens only when deploying to a specific host?
Obviously that is where the problem is likely is then.
If the other hosts don’t have this issue, you could reinstall the problematic host, or replace it entirely.

1) you may want to upgrade your versions of Ansible - and Python, for that matter.

2) if it is only happening on a single host, it makes me wonder if LVM is even installed on that host.

- Rilindo

Upgrading python is a bit more of an adventure. Having multiple bits
of different ansible installations, and different pythons, is a great
way to create debugging messes. So is having different pythons and
different ansible bits on different remote hosts. I'd encourage making
sure that all your ansible servers and remote servers have
/usr/bin/python3 working.

It's why, for the RPM building tools I publish, I go ahead and replace
'#!/usr/bin/python" and "#!/usr/bin/env python" Everywhere with
'#!/usr/bin/python3', as part of the '%setup' stanza, and why I'd
discourage the use of "pip install ansible". "#!/usr/bin/python"
yields python2 on some systems, and that way lies madness.