On 21. okt. 2017 07:45, Sawant wrote:
> [root@ggnmaster2 jenkins]# ls
> hosts site.yml
> [root@ggnmaster2 jenkins]# more site.yml
> ---
> - hosts: jenkins_hosts
> roles:
> - geerlingguy.apache
> #- { role: "geerlingguy.apache" }
> [root@ggnmaster2 jenkins]# vi site.yml
> [root@ggnmaster2 jenkins]# ansible-playbook site.yml
> ERROR! Syntax Error while loading YAML.
>
> The error appears to have been in '/root/MyPlaybooks/jenkins/site.yml':
> line 3, column 1, but may
> be elsewhere in the file depending on the exact syntax problem.
> The offending line appears to be:
> - hosts: jenkins_hosts
> roles:
> ^ here
> [root@ggnmaster2 jenkins]# ls /etc/ansible/roles/geerlingguy.jenkins/
> defaults handlers LICENSE meta README.md tasks templates tests vars
> [root@ggnmaster2 jenkins]# more site.yml
> ---
> - hosts: jenkins_hosts
> roles:
> - { role: "geerlingguy.apache" }
> [root@ggnmaster2 jenkins]# ls /etc/ansible/roles/geerlingguy.apache/
> defaults handlers LICENSE meta README.md tasks templates tests vars
Your indentation is incorrect, indentation in YAML is very important.
So start by reading this to get a basic understanding of YAML
https://docs.ansible.com/ansible/latest/YAMLSyntax.html
Then look at the playbooks examples here to see how they are indented
https://docs.ansible.com/ansible/latest/playbooks_intro.html#playbook-language-example
--
Kai Stian Olstad
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5dc2e7e4-34b8-7363-0897-0de5154e5747%40olstad.com.
For more options, visit https://groups.google.com/d/optout.