On 04/11/2014 03:20 AM, WS wrote:
Hello
I just started to use ansible so please bear with me. I managed to run
a few basic playbooks but I am stuck with the following one (basic as
well):
|
---
-hosts:all
tasks:
-name:copy bashrc to .bashrc
action:copy src=files/bashrc dest=~root/.bashrc backup=yes
-name:copy bashrc to .bash_profile
action:copy src=files/bashrc dest=~root/.bash_profile backup=yes
-name:ensurejoe isinstalled apt
apt:pkg=joe state=latest update_cache=yes
when:ansible_os_family =="Debian"
-name:ensurejoe isinstalled yum
apt:name=joe state=latest
when:ansible_os_family =="CentOS"oransible_os_family =="Fedora"
|
I get the following error when running it:
|
ERROR:SyntaxErrorwhileloading YAML script,commonconfig.yml
Note:Theerror may actually appear before thisposition:line 7,column 1
-name:copy bashrc to .bash_profile
action:copy src=files/bashrc dest=~root/.bash_profile backup=yes
|
The script runs fine when there is only one name/action pair (the
first one).
Sorry if this is obvious but I am just starting with YAML.
--
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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/4e2abd33-13a7-4489-97eb-8ac4f8e6310f%40googlegroups.com
<https://groups.google.com/d/msgid/ansible-project/4e2abd33-13a7-4489-97eb-8ac4f8e6310f%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
It seems like the error is pointing out that action: is not aligned with
name:
I'm not sure what editor you are using but perhaps you could replace all
tabs with spaces and then make sure things are lined up correctly.
http://stackoverflow.com/questions/11094383/how-can-i-convert-tabs-to-spaces-in-every-file-of-a-directory
--
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/53481318.6060903%40gmail.com.
For more options, visit https://groups.google.com/d/optout.