- I cannot get any playbook to work
- I am trying to use Ansible to configure cloud VM's for me.
- Macbook Pro is my central system

Here is my first playbook:

Julians-Macbook-Pro:deploy_with_ansible julianbrown$ cat 
deploy_julian_bin.yml
---
- hosts: all
remote_user: root

tasks:
- name: deploy bin git repo
  git:
    repo: XXXXXXXXXXXXXXXXXXXXXXXXXX [ removed for privacy reasons ]
    dest: /root/bin
    version: master


So I am trying to follow playbooks and use them.

/etc/ansible/hosts

[all]
testing.tld

Julians-Macbook-Pro:deploy_with_ansible julianbrown$ ansible --version
ansible 2.4.0.0
  config file = 
/Users/julianbrown/ansible_deploy/deploy_with_ansible/ansible.cfg
  configured module search path = 
[u'/Users/julianbrown/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/usr/local/Cellar/ansible/2.4.0.0/libexec/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.14 (default, Sep 25 2017, 09:53:22) [GCC 4.2.1 
Compatible Apple LLVM 9.0.0 (clang-900.0.37)]

I get a syntax error, yet that is exactly the structure of most playbooks I 
have seen.

Julians-Macbook-Pro:deploy_with_ansible julianbrown$ ansible-playbook 
deploy_julian_bin.yml
ERROR! Syntax Error while loading YAML.


The error appears to have been in 
'/Users/julianbrown/ansible_deploy/deploy_with_ansible/deploy_julian_bin.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: all
remote_user: root
^ here

exception type: <class 'yaml.parser.ParserError'>
exception: while parsing a block collection
  in "<unicode string>", line 2, column 1
did not find expected '-' indicator
  in "<unicode string>", line 3, column 1


What am I doing wrong?

Thanx

Julian

-- 
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/28f82479-2eee-4461-a9d2-f9a54fe225eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to