From c61e8fe767d517272aa797587cde7bd3718c808b Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 2 Feb 2017 14:52:04 +0100 Subject: [PATCH] library/roles/apache: Add the possibility to install a newer apache package from an Ubuntu PPA. --- apache/defaults/main.yml | 2 ++ apache/tasks/apache-ppa.yml | 14 ++++++++++++++ apache/tasks/main.yml | 1 + 3 files changed, 17 insertions(+) create mode 100644 apache/tasks/apache-ppa.yml diff --git a/apache/defaults/main.yml b/apache/defaults/main.yml index 16737023..db86a937 100644 --- a/apache/defaults/main.yml +++ b/apache/defaults/main.yml @@ -2,6 +2,8 @@ apache_service_enabled: True apache_user: www-data apache_group: '{{ apache_user }}' +apache_from_ppa: False +apache_ppa_repo: 'ppa:ondrej/apache2' # Possible choices: event, prefork (the old ones), worker (the threaded version), itm apache_mpm_mode: worker diff --git a/apache/tasks/apache-ppa.yml b/apache/tasks/apache-ppa.yml new file mode 100644 index 00000000..33a10997 --- /dev/null +++ b/apache/tasks/apache-ppa.yml @@ -0,0 +1,14 @@ +--- +- block: + - name: Install the Ubuntu apache PPA + apt_repository: repo='{{ apache_ppa_repo }}' update_cache=yes + + when: apache_from_ppa + tags: [ 'apache', 'apache_ppa' ] + +- block: + - name: Remove the Ubuntu apache PPA + apt_repository: repo='{{ apache_ppa_repo }}' update_cache=yes state=absent + + when: not apache_from_ppa + tags: [ 'apache', 'apache_ppa' ] diff --git a/apache/tasks/main.yml b/apache/tasks/main.yml index a3d5e85d..b0984c8f 100644 --- a/apache/tasks/main.yml +++ b/apache/tasks/main.yml @@ -1,4 +1,5 @@ --- +- include: apache-ppa.yml - include: apache.yml - include: apache-modules.yml - include: apache-basic-auth.yml