From ff20908f5be2847eaf46d5f9e44193325393a3d5 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Wed, 3 Aug 2016 13:37:03 +0200
Subject: [PATCH] ansible-roles/apache#4 Change roles and inventory to change
 Apache default version to 2.4

---
 defaults/main.yml                              | 3 ---
 tasks/apache.yml                               | 4 ++--
 templates/etc-apache2-sites-available-sd-agent | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/defaults/main.yml b/defaults/main.yml
index 443c695..5eb3342 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -21,7 +21,4 @@ sd_plugins_files_dir: "{{ playbook_dir }}/files/sd-plugins"
 
 sd_uninstallv1: no
 
-apache_conf_dir: 'conf.d'
-apache_conf_ext: ''
-
 mysql_root_password: 'root'
diff --git a/tasks/apache.yml b/tasks/apache.yml
index a769ed5..ae329e8 100644
--- a/tasks/apache.yml
+++ b/tasks/apache.yml
@@ -27,12 +27,12 @@
 - name: "ServerDensity | Apache | Configuration file for ServerDensity"
   template:
     src=etc-apache2-sites-available-sd-agent
-    dest=/etc/apache2/sites-available/sd-agent{{ apache_conf_ext }}
+    dest=/etc/apache2/sites-available/sd-agent{{ apache_conf_ext|default('.conf') }}
     owner=root
     group=root
     mode=0644
   notify: "ServerDensity | Restart Apache"
 
 - name: "ServerDensity | Apache | Enable the sd-agent site"
-  command: a2ensite sd-agent creates=/etc/apache2/sites-enabled/sd-agent{{ apache_conf_ext }}
+  command: a2ensite sd-agent creates=/etc/apache2/sites-enabled/sd-agent{{ apache_conf_ext|default('.conf') }}
   notify: "ServerDensity | Restart Apache"
diff --git a/templates/etc-apache2-sites-available-sd-agent b/templates/etc-apache2-sites-available-sd-agent
index 3c227ca..5d2c5fd 100644
--- a/templates/etc-apache2-sites-available-sd-agent
+++ b/templates/etc-apache2-sites-available-sd-agent
@@ -1,5 +1,5 @@
 <VirtualHost *:80>
-  Include /etc/apache2/{{ apache_conf_dir }}/global-redirect.conf
+  Include /etc/apache2/{{ apache_conf_dir|default('conf-available') }}/global-redirect.conf
 
   ServerName {{ inventory_hostname }}
   <Location /server-status>
-- 
GitLab