From 0f0353d4514986d481cd0cc5f1b2bf735ed54663 Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Thu, 1 Sep 2016 17:06:39 +0200
Subject: [PATCH] [FEATURE] Add option to enable/disable HTTP2

---
 attributes/default.rb | 1 +
 recipes/default.rb    | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/attributes/default.rb b/attributes/default.rb
index 896b903..e75cfe6 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -4,6 +4,7 @@ default['typo3_site']['site_configuration'] = 'SiteConfiguration.php'
 default['typo3_site']['server_aliases'] = 'www.site.dev'
 default['typo3_site']['hostname'] = 'site.dev'
 default['typo3_site']['web_directory'] = ''
+default['typo3_site']['allow_http2'] = false
 default['typo3_site']['repository'] = ''
 default['typo3_site']['repository_hostname'] = ''
 default['typo3_site']['repository_port'] = 22
diff --git a/recipes/default.rb b/recipes/default.rb
index 1ba6303..60952c7 100644
--- a/recipes/default.rb
+++ b/recipes/default.rb
@@ -55,7 +55,7 @@ if node['platform_version'] == '16.04'
 		action :add
 	end
 
-	execute 'apt-get -y update'
+	execute 'apt -y update'
 end
 
 include_recipe 'graphicsmagick'
@@ -72,6 +72,12 @@ if node['platform_version'] == '16.04'
 
 	apache_module 'http2' do
 		enable true
+		only_if { node['typo3_site']['allow_http2'] }
+	end
+
+	apache_module 'http2' do
+		disable true
+		only_if { not node['typo3_site']['allow_http2'] }
 	end
 else
 	include_recipe 'apache2::mod_php5'
-- 
GitLab