Hello All,
I am getting "ERROR: tasks is not a legal parameter in an Ansible task or
handler" while running play book with roles but the same code is running
fine with plain yaml.
cat /etc/ansible/roles/webservers/tasks/main.yml
---
- hosts: local
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: ensure apache is at the latest version
yum: pkg=httpd state=latest
- name: write the apache config file
template: src=/etc/ansible/roles/webservers/templates/httpd.j2
dest=/etc/httpd/conf/httpd.conf
notify:
- restart apache
- name: ensure apache is running (and enable it at boot)
service: name=httpd state=started enabled=yes
cat /etc/ansible/roles/webservers/handlers/main.yml
---
- name: restart apache
service: name=httpd state=restarted
cat /etc/ansible/site.yml
---
- hosts: local
roles:
- role: webservers
# - webservers
ansible]# ansible-playbook site.yml
ERROR: tasks is not a legal parameter in an Ansible task or handler
Any help will be appreciated.
Thank,
Aforz
--
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/a50320dc-290f-4a86-9447-1a9518732019%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.