# problem while running role

**URL:** <https://forum.ansible.com/t/problem-while-running-role/36322>\
**Category:** Ansible Project\
**Created:** [February 11, 2022, 1:55pm UTC](https://forum.ansible.com/t/problem-while-running-role/36322 "2022-02-11T13:55:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashir](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Ashir](https://forum.ansible.com/u/Ashir)\
**Post date:** [February 11, 2022, 1:55pm UTC](https://forum.ansible.com/t/problem-while-running-role/36322/1 "2022-02-11T13:55:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 11, 2022, 2:30pm UTC](https://forum.ansible.com/t/problem-while-running-role/36322/2 "2022-02-11T14:30:34Z")

</div>

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"

---

<div class="post-metadata">

**Author:** ![Ashir](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Ashir](https://forum.ansible.com/u/Ashir)\
**Post date:** [February 12, 2022, 5:48pm UTC](https://forum.ansible.com/t/problem-while-running-role/36322/3 "2022-02-12T17:48:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 12, 2022, 5:57pm UTC](https://forum.ansible.com/t/problem-while-running-role/36322/4 "2022-02-12T17:57:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ashir](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Ashir](https://forum.ansible.com/u/Ashir)\
**Post date:** [February 12, 2022, 6:05pm UTC](https://forum.ansible.com/t/problem-while-running-role/36322/5 "2022-02-12T18:05:44Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 12, 2022, 7:07pm UTC](https://forum.ansible.com/t/problem-while-running-role/36322/6 "2022-02-12T19:07:57Z")

</div>

Did this archeological setup work before?

---

<div class="post-metadata">

**Author:** ![Ashir](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@Ashir](https://forum.ansible.com/u/Ashir)\
**Post date:** [February 13, 2022, 4:08am UTC](https://forum.ansible.com/t/problem-while-running-role/36322/7 "2022-02-13T04:08:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rilindo\_Foster1](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Rilindo\_Foster1](https://forum.ansible.com/u/Rilindo_Foster1)\
**Post date:** [February 13, 2022, 5:18am UTC](https://forum.ansible.com/t/problem-while-running-role/36322/8 "2022-02-13T05:18:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 13, 2022, 7:55am UTC](https://forum.ansible.com/t/problem-while-running-role/36322/9 "2022-02-13T07:55:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel-Garcia](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nico_kadel-garcia/32/9998_2.png) [@Nico\_Kadel-Garcia](https://forum.ansible.com/u/Nico_Kadel-Garcia)\
**Post date:** [February 13, 2022, 10:37am UTC](https://forum.ansible.com/t/problem-while-running-role/36322/10 "2022-02-13T10:37:39Z")

</div>

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