- 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
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']
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