ERROR: Error reading config file (/Users/user/.ansible.cfg): Source contains parsing errors: '<string>'

1,045 views
Skip to first unread message

Çağlayan Sancaktar

unread,
Oct 20, 2022, 1:33:27 PM10/20/22
to Ansible Project
Hi, I got this error 
>>
ERROR: Error reading config file (/Users/sahabt/.ansible.cfg): Source contains parsing errors: '<string>'
<<

My .ansible.cfg file's content like this:
>>
[node5]
172.17.0.2
~
~
<<

Can you help me ? What am i doing wrong?

Rowe, Walter P. (Fed)

unread,
Oct 20, 2022, 1:39:09 PM10/20/22
to ansible...@googlegroups.com
That looks like an inventory syntax vs an ansible config syntax.

Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/efa7a928-a110-4d6b-b914-bc3eabca43a4n%40googlegroups.com.

Çağlayan Sancaktar

unread,
Oct 20, 2022, 2:05:10 PM10/20/22
to Ansible Project
I fixed it.

First of all I created a hosts file in /etc/ansible

then I run this command in main path
ansible-config init --disabled all > .ansible.cfg

next I added to .ansible.cfg file this line:
nventory = /etc/ansible/hosts

finally I could list my hosts.

Thanks.
20 Ekim 2022 Perşembe tarihinde saat 20:39:09 UTC+3 itibarıyla walte...@nist.gov şunları yazdı:
Reply all
Reply to author
Forward
0 new messages