Closed krunalcc1 closed 4 years ago
Hi @krunalcc1, the issue is happening because of the YAML syntax. Below is the formatting that the uname.yml
file should have. As you can see the tabbing is a bit different than what you posted in the comment.
- hosts: webservers:loadbalancers
tasks:
- name: Get OS type
shell: uname
And this is what you have, which will throw a syntax error:
hosts: webservers:loadbalancers
tasks:
-name: Get OS type
shell: uname
I went ahead and added an .editorconfig
file to the repository so the end users text editor knows how to format the YAML code. Please let me know if you are still having issues?
Good luck!
Closing issue due to longevity of issue.
getting error while running this script.
uname.yml
ansible-playbook uname.yml ERROR! Syntax Error while loading YAML. mapping values are not allowed here
The error appears to have been in '/home/XYZ/.ansible/uname.yml': line 7, column 13, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be: