While this may not be the cause of your issues, the following is (or will 
be) an issue for you.

  - name: ensure joe is installed yum
    apt: name=joe state=latest
    when: ansible_os_family == "CentOS" or ansible_os_family == "Fedora"

change to:

  - name: ensure joe is installed yum
    yum: name=joe state=latest
    when: ansible_os_family == "CentOS" or ansible_os_family == "Fedora"

On Friday, April 11, 2014 11:06:48 AM UTC-5, James Tanner wrote:
>
>  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: ensure joe is installed apt
>     apt: pkg=joe state=latest update_cache=yes
>     when: ansible_os_family == "Debian"
>   - name: ensure joe is installed yum
>     apt: name=joe state=latest
>     when: ansible_os_family == "CentOS" or ansible_os_family == "Fedora"
>
>  
>
>  I get the following error when running it:
>
>   ERROR: Syntax Error while loading YAML script, commonconfig.yml
> Note: The error may actually appear before this position: 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] <javascript:>.
> To post to this group, send email to [email protected]<javascript:>
> .
> 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/320d70dc-b234-49b5-b4b2-eae3554398d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to