Hello
i run a playbook and do get this error message
:/etc/ansible$ ansible-playbook -u dokuwa1 --ask-pass playbook/apache.yml
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/etc/ansible/playbook/apache.yml': line
3, column 2, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- hosts: all
vars_files:
^ here
This is the playbook
---
- hosts: all
vars_files:
- vars.yml
sudo: yes
tasks:
- name: install apache2
apt: name={{item}} state=present update_cache=yes
with_items:
- libapache2-mod-wsgi
- python-pip
- python-virtualenv
- name: start apache service
service: name=apache2 state=started enabled=yes
- name : verify apache service
command: service apache2 status
- name: verify apache listening port is 80
wait_for: port=80 timeout=1
- name: ensure mod_wsgi enabled
apache2_module: state=present name=wsgi
notify: restart apache2
- name: copy files
copy: src=/etc/ansible/playbook/ dest=/tmp mode=0755
notify: restart apache2
- name: delete a file
file: path=/tmp/apache.yml state=absent
- name: reinstate file that was deleted
lineinfile: dest=/tmp/hostname.yml regexp=^hostname
line="ping 192.168.85.129"
handlers:
- name: restart apache2
service: name=apache2 state=restarted
The issue is with the variable vars which is vars.yml which is in the same
directory with apache.yml
this is also the vars.yml file
more playbook/vars.yml ---
auth:
- { username: dokuwa1, password: xxxxxx }
Thanks
--
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/c1d934eb-bdc4-4510-b982-480785432b80%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.