Skip to content

Commit

Permalink
Merge pull request yevgenko#6 from Fapiko/master
Browse files Browse the repository at this point in the history
Fix installation on CentOS/RH
  • Loading branch information
yevgenko committed Mar 2, 2013
2 parents 2f58d96 + feb76e5 commit 0fa6947
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 57 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
metadata.json

# IDE project settings
.idea
114 changes: 57 additions & 57 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,72 +19,71 @@
#

case node['platform']
when 'ubuntu'
if node['platform_version'].to_f <= 10.04
# Configure Brian's PPA
# We'll install php5-fpm from the Brian's PPA backports
apt_repository "brianmercer-php" do
uri "http://ppa.launchpad.net/brianmercer/php5/ubuntu"
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com"
key "8D0DC64F"
action :add
when 'ubuntu'
if node['platform_version'].to_f <= 10.04
# Configure Brian's PPA
# We'll install php5-fpm from the Brian's PPA backports
apt_repository "brianmercer-php" do
uri "http://ppa.launchpad.net/brianmercer/php5/ubuntu"
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com"
key "8D0DC64F"
action :add
end
# FIXME: apt-get update didn't trigger in above
execute "apt-get update"
end
# FIXME: apt-get update didn't trigger in above
execute "apt-get update"
end
when 'debian'
# Configure Dotdeb repos
# TODO: move this to it's own 'dotdeb' cookbook?
# http://www.dotdeb.org/instructions/
if node.platform_version.to_f >= 5.0
apt_repository "dotdeb" do
uri "http://packages.dotdeb.org"
distribution "stable"
components ['all']
key "http://www.dotdeb.org/dotdeb.gpg"
action :add
when 'debian'
# Configure Dotdeb repos
# TODO: move this to it's own 'dotdeb' cookbook?
# http://www.dotdeb.org/instructions/
if node.platform_version.to_f >= 5.0
apt_repository "dotdeb" do
uri "http://packages.dotdeb.org"
distribution "stable"
components ['all']
key "http://www.dotdeb.org/dotdeb.gpg"
action :add
end
else
apt_repository "dotdeb" do
uri "http://packages.dotdeb.org"
distribution "oldstable"
components ['all']
key "http://www.dotdeb.org/dotdeb.gpg"
action :add
end
apt_repository "dotdeb-php53" do
uri "http://php53.dotdeb.org"
distribution "oldstable"
components ['all']
key "http://www.dotdeb.org/dotdeb.gpg"
action :add
end
end
else
apt_repository "dotdeb" do
uri "http://packages.dotdeb.org"
distribution "oldstable"
components ['all']
key "http://www.dotdeb.org/dotdeb.gpg"
action :add

when 'centos', 'redhat'
yum_key 'RPM-GPG-KEY-remi' do
url 'http://rpms.famillecollet.com/RPM-GPG-KEY-remi'
end
apt_repository "dotdeb-php53" do
uri "http://php53.dotdeb.org"
distribution "oldstable"
components ['all']
key "http://www.dotdeb.org/dotdeb.gpg"

yum_repository 'remi' do
description 'Remi'
url 'http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/'
mirrorlist 'http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror'
key 'RPM-GPG-KEY-remi'
action :add
end
end
when 'centos', 'redhat'
# Configure IUS repo
# http://rob.olmos.name/2010/08/centos-5-5-php-5-3-3-php-fpm-nginx-rpms/
# TODO: verify this is the best repo
yum_repository "ius" do
url "http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/$basearch"
action :add
end
end

pkgs = value_for_platform(
%w{ centos redhat } => {
"default" => %w{ php53u-fpm and php53u-pecl-apc }
},
%w{ fedora } => {
%w{ centos redhat fedora amazon } => {
"default" => %w{ php-fpm }
},
%w{ debian ubuntu } => {
"default" => %w{ php5-fpm }
},
%w{ amazon } => {
"default" => %w{ php-fpm }
},
"default" => %w{ php5-fpm }
)

Expand All @@ -94,10 +93,11 @@
end
end

if node['platform'] == 'amazon' or node['platform'] == 'fedora' then
php_fpm_service_name = "php-fpm"
else
php_fpm_service_name = "php5-fpm"
case node['platform']
when 'amazon', 'fedora', 'centos', 'redhat'
php_fpm_service_name = "php-fpm"
else
php_fpm_service_name = "php5-fpm"
end

service php_fpm_service_name do
Expand Down

0 comments on commit 0fa6947

Please sign in to comment.