jdauphant / ansible-role-nginx

Ansible role to install and manage nginx configuration
655 stars 302 forks source link

Error in handlers/main.yml #211

Closed praveen049 closed 6 years ago

praveen049 commented 6 years ago

Hi I am following the README and trying to install nginx in example-1. Install nginx with HTTP directives of choice, but with no sites configured and no additional configuration. I have installed the role and trying to use it in a play book as below

- hosts: webserver
  roles:
  - {role: jdauphant.nginx,
     nginx_http_params: ["sendfile on", "access_log /var/log/nginx/access.log"]

but i am getting the below error when i run it as ansible-playbook -i hosts nginx_play.yml

Error

ERROR! The handlers/main.yml file for role 'jdauphant.nginx' must contain a list of tasks
The error appears to have been in '/etc/ansible/roles/jdauphant.nginx/tasks/main.yml': line 3, column 1, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:
- include_vars: "{{ item }}"
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - "{{ foo }}"

Can you let me know what i am doing wrong ?

The sensible version is

ansible 2.0.0.2
  config file = /root/ansible-mgmt/ansible.cfg
  configured module search path = Default w/o overrides
praveen049 commented 6 years ago

I found the reason for my problem. I was having a lower version of ansible that what was mentioned in the sensible galaxy download page. Updating the package to the latest version solved the issue.