# A basic ansible command cannot go through

**URL:** <https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220>\
**Category:** Ansible Project\
**Created:** [January 19, 2022, 4:39am UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220 "2022-01-19T04:39:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Y](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@Kevin\_Y](https://forum.ansible.com/u/Kevin_Y)\
**Post date:** [January 19, 2022, 4:39am UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220/1 "2022-01-19T04:39:48Z")

</div>

Hi I am a little new to ansible. Anyone can take a look at the below why the command cannot go through? Thank you!

admin1@Len:~$ **ansible lab-hosts -m raw -a “show run” -u admin -k | grep** ‘hostname| system mtu’  
Traceback (most recent call last):  
File “/usr/bin/ansible”, line 34, in   
from ansible import context  
File “/usr/local/lib/python3.8/dist-packages/ansible/context.py”, line 18, in   
from ansible.module\_utils.common.\_collections\_compat import Mapping, Set  
ModuleNotFoundError: No module named ‘ansible.module\_utils’

---

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [January 19, 2022, 10:43am UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220/2 "2022-01-19T10:43:06Z")

</div>

I have not used the raw module ever. That being said … I believe generally ad hoc comands need the arduments to be quoted as a whole.

Do I wonder whether this may work better?

**ansible lab-hosts -m raw -a “show run -u admin -k | grep ‘hostname| system mtu’”**

I am used to single quotes around arguments. But as you have some in the grep portion of your command already I’d try double quotes aroung the entire argument as used above

Also going through your error … ModuleNotFoundError: No module named ‘ansible.module\_utils’ sounds suspicious.  
Can you display the manual via ansible-doc raw ?

---

<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:** [January 19, 2022, 10:51am UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220/3 "2022-01-19T10:51:32Z")

</div>

looks like your installation is messed up.

What does ‘ansible --version’ say?

---

<div class="post-metadata">

**Author:** ![Kevin\_Y](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@Kevin\_Y](https://forum.ansible.com/u/Kevin_Y)\
**Post date:** [January 19, 2022, 3:40pm UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220/4 "2022-01-19T15:40:25Z")

</div>

Hi Dick, Thanks for your reply. I tried it with different quotes. all of them cannot work.  
any other suggestions?

---

<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:** [January 20, 2022, 6:53pm UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220/5 "2022-01-20T18:53:51Z")

</div>

The quoting was to make it clear what should be typed at the command line.  
So you should not type quotes. Just type

ansible --version

---

<div class="post-metadata">

**Author:** ![Evan\_Hisey](https://avatars.discourse-cdn.com/v4/letter/e/ce73a5/32.png) [@Evan\_Hisey](https://forum.ansible.com/u/Evan_Hisey)\
**Post date:** [January 22, 2022, 5:41pm UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220/6 "2022-01-22T17:41:00Z")

</div>

Are you connecting to a Cisco network device? If so this commend will fail, as the you need to you a different method of connecting an execution since Cisco switches don’t support python.

---

<div class="post-metadata">

**Author:** ![Nilashish\_Chakrabort](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Nilashish\_Chakrabort](https://forum.ansible.com/u/Nilashish_Chakrabort)\
**Post date:** [January 31, 2022, 6:59am UTC](https://forum.ansible.com/t/a-basic-ansible-command-cannot-go-through/36220/7 "2022-01-31T06:59:27Z")

</div>

Hello Kevin,

Please refer to the [Ansible Network Getting Started](https://docs.ansible.com/ansible/latest/network/getting_started/index.html#network-getting-started) doc for guidance on how to execute commands on supported network devices.

Thank you.
