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