# ansible hosts file yaml errors DUO authentication

**URL:** <https://forum.ansible.com/t/ansible-hosts-file-yaml-errors-duo-authentication/27458>\
**Category:** Ansible Project\
**Created:** [May 4, 2018, 3:00pm UTC](https://forum.ansible.com/t/ansible-hosts-file-yaml-errors-duo-authentication/27458 "2018-05-04T15:00:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tedley\_Meralus](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@Tedley\_Meralus](https://forum.ansible.com/u/Tedley_Meralus)\
**Post date:** [May 4, 2018, 3:00pm UTC](https://forum.ansible.com/t/ansible-hosts-file-yaml-errors-duo-authentication/27458/1 "2018-05-04T15:00:21Z")

</div>

I added a new group in my hosts file in ansible and now when I try to ping I get this error.

$ ansible book01 -m ping

[WARNING]: \* Failed to parse /etc/ansible/hosts with yaml plugin: Syntax Error while loading YAML. The  
error appears to have been in ‘/etc/ansible/hosts’: line 55, column 1, but may be elsewhere in the file  
depending on the exact syntax problem. The offending line appears to be: [content-management] ^ here  
exception type: \<class ‘yaml.parser.ParserError’\> exception: did not find expected in  
“”, line 55, column 1

[WARNING]: \* Failed to parse /etc/ansible/hosts with ini plugin: /etc/ansible/hosts:113: Expected  
key=value host variable assignment, got: 10.2.8.124

[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

[WARNING]: No inventory was parsed, only implicit localhost is available

I thought there may have been something wrong with whitespaces involved but that doesnt seem to be  
the case and I feel a bit confused now.

# snippet of playbook

[ntp-servers]  
book01 ansible\_host=10.2.8.62  
book02 ansible\_host=10.2.8.61

[content-management]  
cosmo ansible\_host=172.16.120.222  
phobos ansible\_host=172.16.120.209

NOTE: this server is configured to use DUO 2FA authentication. The ansible user in duo is set to bypass mode so now authentication prompt will show up to interrupt ansibles ping request ( but I could be wrong and that could be another issue in itself)
