From e1d7b8e73cd21bb61bc0bc658dd794db43ce4231 Mon Sep 17 00:00:00 2001 From: Christopher Webber Date: Thu, 16 Oct 2014 13:27:33 -0700 Subject: [PATCH] Adds support for 14.04 Closes #13 --- .kitchen.yml | 4 ++++ recipes/default.rb | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.kitchen.yml b/.kitchen.yml index 6cedc02..ad7d322 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -10,6 +10,10 @@ platforms: driver_config: network: - ["forwarded_port", {guest: 80, host: 8080, guest: 443, host: 8443}] + - name: ubuntu-14.04 + driver_config: + network: + - ["forwarded_port", {guest: 80, host: 8080, guest: 443, host: 8443}] - name: centos-6.5 driver_config: network: diff --git a/recipes/default.rb b/recipes/default.rb index 3af9bab..4aab7d0 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -17,11 +17,19 @@ webserver = node[:magento][:webserver] user = node[:magento][:user] group = node[webserver]['group'] - php_conf = if platform?('centos', 'redhat') - ['/etc', '/etc/php.d'] - else - ['/etc/php5/fpm', '/etc/php5/conf.d'] - end + + if platform?('centos', 'redhat') + php_conf = ['/etc', '/etc/php.d'] + apc_config = 'apc.ini' + else + if platform?('ubuntu') && node[:platform_version] == '14.04' + php_conf = ['/etc/php5/fpm', '/etc/php5/fpm/conf.d'] + apc_config = '20-apcu.ini' + else + php_conf = ['/etc/php5/fpm', '/etc/php5/conf.d'] + apc_config = 'apc.ini' + end + end user "#{user}" do comment 'magento guy' @@ -58,7 +66,7 @@ bash 'Tweak apc.ini file' do cwd php_conf[1] # module ini files code <<-EOH - grep -q -e 'apc.stat=0' apc.ini || echo "apc.stat=0" >> apc.ini + grep -q -e 'apc.stat=0' #{apc_config} || echo "apc.stat=0" >> #{apc_config} EOH end