From ce6fcc45fe80f28a30542ed8daa9d08d99132e8a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 13 Sep 2016 18:41:27 +0200 Subject: [PATCH] library/roles/apache: Fix the fact that ubuntu 12.04 and 14.04 have different paths for the additional configurations. --- apache/tasks/apache-basic-auth.yml | 2 +- apache/tasks/apache-letsencrypt.yml | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) 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