Open riotCode opened 10 years ago
If someone finds this via google, like I did, I thought I'd share the code I ended up with
when "ubuntu"
include_recipe "apt"
package "python-software-properties" do
action :install
end
apt_repository "ondrej-php-#{node["lsb"]["codename"]}" do
uri "http://ppa.launchpad.net/ondrej/php5/ubuntu"
distribution node["lsb"]["codename"]
components ["main"]
keyserver "keyserver.ubuntu.com"
key "E5267A6C"
end
[ "php5", "php5-mysql", "php5-curl", "php5-mcrypt" ].each do |pkg|
package pkg do
action :install
version "5.5.*"
notifies :restart, "service[apache2]", :delayed
notifies :run, "execute[apt-get autoremove]", :delayed
end
end
end
or, even better, use the php5_ppa cookbook: http://community.opscode.com/cookbooks/php5_ppa replacing
apt_repository "ondrej-php-#{node["lsb"]["codename"]}" do
uri "http://ppa.launchpad.net/ondrej/php5/ubuntu"
distribution node["lsb"]["codename"]
components ["main"]
keyserver "keyserver.ubuntu.com"
key "E5267A6C"
end
with
include_recipe "php5_ppa::from_ondrej"
I'd also recommend taking a look at the apache 2.4 cookbook here http://github.com/onehealth-cookbooks/apache2-onehealth
It seems that this recipe doesn't actually configure for ubuntu, the final
when "debian"
is only referencing the "platform" not the "platform_family". Included "ubuntu" but the package did not install properly. Soooo... I made a make shift block before it for ubuntu. I would have done a pull request but I am a complete chef/ruby noob so I doubt this is best practice but I figured it could help someone who could apply what I did in a better fashion. :8ball:This works flawlessly on my Vagrant Ubuntu 12.04 provisioning. I might test it on AWS Opsworks later on. Keep in mind the repo installs apache 2.4 as a dependancy so running most apache2 recipes usually cause errors because there are some breaking changes between 2.4 and older versions. I hope this helps, thank you :)