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)