# getting error when test ping on router ios

**URL:** <https://forum.ansible.com/t/getting-error-when-test-ping-on-router-ios/28692>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [October 1, 2018, 9:52am UTC](https://forum.ansible.com/t/getting-error-when-test-ping-on-router-ios/28692 "2018-10-01T09:52:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://forum.ansible.com/u/aris)\
**Post date:** [October 1, 2018, 9:52am UTC](https://forum.ansible.com/t/getting-error-when-test-ping-on-router-ios/28692/1 "2018-10-01T09:52:30Z")

</div>

Hi,

I’m trying test ping using command “ansible -m ping all” and then i getting error bellow :

# ansible -m ping all

[WARNING]: \* Failed to parse /etc/ansible/hosts with yaml plugin: Syntax Error while loading YAML. found unexpected ‘:’ The error appears to have been in  
‘/etc/ansible/hosts’: line 1, column 5, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears to be: [all:vars] ^  
here  
[WARNING]: \* Failed to parse /etc/ansible/hosts with ini plugin: /etc/ansible/hosts:18: Expected key=value, got: $ANSIBLE\_VAULT;1.1;AES256  
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source  
[WARNING]: No inventory was parsed, only implicit localhost is available  
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match ‘all’

this is my inventory hosts :

[all:vars]  
ansible\_connection=network\_cli  
ansible\_user=user

[router:children]  
ios

[ios]  
10.10.1.5

[ios:vars]  
ansible\_become=yes  
ansible\_become\_method=enable  
ansible\_network\_os=ios  
ansible\_user=my\_ios\_user  
ansible\_ssh\_pass= !vault |  
$ANSIBLE\_VAULT;1.1;AES256  
61323831323164346239346133663762653837326630303338363961313834396231656466616161  
6461653339343465386635333832636533643531376661380a333138383665646236326262303362  
30656633383131396461653035663561393938633762623838366464313439386337313631636137  
3836343261363663640a393331653163353864666431396662333735633539343765646635306464  
6563

Any help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![Oriol\_Tauleria](https://avatars.discourse-cdn.com/v4/letter/o/58f4c7/32.png) [@Oriol\_Tauleria](https://forum.ansible.com/u/Oriol_Tauleria)\
**Post date:** [October 18, 2018, 1:22pm UTC](https://forum.ansible.com/t/getting-error-when-test-ping-on-router-ios/28692/2 "2018-10-18T13:22:11Z")

</div>

Hello Aris,  
you are trying to define the hosts file like a ini file (with name=value and group:vars) but you are trying to read like if it’s in yaml format.  
More information about how to describe in yaml/ini format here =\> [https://docs.ansible.com/ansible/latest/user\_guide/intro\_inventory.html](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html)

To change and read as ini file (as default) you need to edit ansible.cfg and comment the line starting with “enable\_plugins” ynder the [inventory] section.

I hope this helps you

---

<div class="post-metadata">

**Author:** ![bill\_paxton](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@bill\_paxton](https://forum.ansible.com/u/bill_paxton)\
**Post date:** [October 18, 2018, 4:16pm UTC](https://forum.ansible.com/t/getting-error-when-test-ping-on-router-ios/28692/3 "2018-10-18T16:16:17Z")

</div>

I don’t believe the ping module will work with any device that cannot run python locally. [https://docs.ansible.com/ansible/2.5/modules/ping\_module.html](https://docs.ansible.com/ansible/2.5/modules/ping_module.html)
