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}
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.
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”
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.