FloeDesignTechnologies / ansible-nginx-drupal

Ansible role to configure Nginx for running Drupal using perusio's configuration
Apache License 2.0
22 stars 12 forks source link

Unable to generate sites config files #24

Closed tseven closed 7 years ago

tseven commented 7 years ago

Thank you for putting this ansible role together. I'm new to ansible but have a decent understanding of what's going on.

I cannot get the role to read the config variables properly.

fatal: [104.154.x.x]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'file_name'\n\nThe error appears to have been in '/Users/stevenkinley/ansible/lamp_simple/roles/FloeDesignTechnologies.nginx-drupal/tasks/sites.yml': line 4, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n file: path={{nginx_drupal_config_path}}/sites-enabled state=directory\n- name: \"Create available sites configuration files\"\n ^ here\n"}

I've tried multiple syntaxes formats, none seem to work.

My playbook.yml

    - role: FloeDesignTechnologies.nginx-drupal
      nginx_drupal_sites:
        - file_name: foo
          server_name: foo.org
          alternate_server_name: www.foo.org
          root: /var/www/foo
          http:
            port: 80

 - { role: FloeDesignTechnologies.nginx-drupal, nginx_drupal_sites: [{ file_name: drupal8.my, server_name: drupal8.my, root: /var/www/drupal8.my/public, http: {port: 80}}]} 

I'm sure I'm missing some subtle syntax thing.

Any help would be appreciated.

Thanks!

fmmribeiro commented 7 years ago

me too O think i relates with the updated version of ansible 2.2.2.0

fmmribeiro commented 7 years ago

Fixed in sites.yml, change with_items: nginx_drupal_sites ----- TO ------ with_items: "{{ nginx_drupal_sites }}"

more info at https://github.com/ansible/ansible/issues/23496

tseven commented 7 years ago

Thanks @fmmribeiro that did the trick!