theres an intro to yaml syntax here.
http://docs.ansible.com/ansible/YAMLSyntax.html
be carefull cutting and pasting from groups because things can get
reformatted. heres an example with the code highlighting. i hope it comes
out ok. also, you can put multiple variables in a single module call like
this.
---
- hosts: group1
user: user1
sudo: yes
gather_facts: yes
tasks:
- name: ensure update
apt: update_cache=yes upgrade=full cache_valid_time=3600
On Monday, October 5, 2015 at 5:05:31 AM UTC-7, ansible_novice wrote:
>
> I`m trying to launch one playbook:
>
> ---
> - hosts:group1
> user:user1
> sudo:yes
> gather_facts:yes
>
> tasks:
> - name: ensure update
> apt:update_cache=yes
> apt:upgrade=full
>
> I`m running this by command sudo ansible-playbook -i /etc/ansible/hosts
> test1.yml and Ansible said that my playbook has syntax error.
>
> ERROR: Syntax Error while loading YAML script, test1.yml
> Note: The error may actually appear before this position: line 7, column 7
>
>
> tasks:
> ^
>
> Maybe someone had similar problem, who knows, what is the reason of error,
> give me an answer, please.
>
--
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/f06acb90-7a4e-4dcb-ad2f-add85b84a88f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.