diff --git a/apache/tasks/apache-basic-auth.yml b/apache/tasks/apache-basic-auth.yml index 32dce01..89ea71a 100644 --- a/apache/tasks/apache-basic-auth.yml +++ b/apache/tasks/apache-basic-auth.yml @@ -29,7 +29,7 @@ - name: Create the basic auth file htpasswd: path={{ item.auth_file }} name={{ item.username }} password={{ item.password }} create=yes state={{ item.state }} - with_items: '{{ apache_basic_users }}' + with_items: '{{ apache_basic_users | default([]) }}' when: apache_basic_users is defined and not apache_basic_auth_single_file tags: - apache diff --git a/apache/tasks/apache-letsencrypt.yml b/apache/tasks/apache-letsencrypt.yml index b8c9a05..f9a2faf 100644 --- a/apache/tasks/apache-letsencrypt.yml +++ b/apache/tasks/apache-letsencrypt.yml @@ -5,14 +5,22 @@ with_items: '{{ apache_letsencrypt_proxy_modules }}' notify: apache2 reload - - name: Install the letsencrypt conf + - name: Install the apache letsencrypt directives on trusty template: src={{ item }}.j2 dest=/etc/apache2/conf-available/{{ item }} owner=root group=root mode=0644 with_items: '{{ apache_letsencrypt_proxy_conf }}' + when: is_trusty notify: apache2 reload - - name: Enable the letsencrypt conf + - name: Enable the apache letsencrypt directives on trusty file: src=/etc/apache2/conf-available/{{ item }} dest=/etc/apache2/conf-enabled/{{ item }} state=link with_items: '{{ apache_letsencrypt_proxy_conf }}' + when: is_trusty + notify: apache2 reload + + - name: Install the apache letsencrypt directives on precise + template: src={{ item }}.j2 dest=/etc/apache2/conf.d/{{ item }} owner=root group=root mode=0644 + with_items: '{{ apache_letsencrypt_proxy_conf }}' + when: is_precise notify: apache2 reload - name: Create the acme hooks directory if it does not yet exist