Permalink
Browse files

fixing stuff

  • Loading branch information...
1 parent 60e971f commit 5b8ceda8a9a43536268af9d5170d344aae42440f Simon committed Apr 10, 2012
Showing with 22 additions and 21 deletions.
  1. +1 −1 chef-repo/cookbooks/java/attributes/default.rb
  2. +21 −20 chef-repo/cookbooks/mysql/recipes/server55.rb
View
2 chef-repo/cookbooks/java/attributes/default.rb
@@ -23,7 +23,7 @@
default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586"
case platform
-when "centos","redhat","fedora","scientific","amazon"
+when "centos","redhat","fedora","scientific","amazon", "ubuntu"
default['java']['java_home'] = "/usr/lib/jvm/java"
when "freebsd"
default['java']['java_home'] = "/usr/local/openjdk#{java['jdk_version']}"
View
41 chef-repo/cookbooks/mysql/recipes/server55.rb
@@ -6,6 +6,7 @@
include_recipe "mysql::cleanup_mysql"
+#TODO: use this for now, but move to using REMI repo for Redhat
#Download MySQL RPMs
arch="#{node['kernel']['machine']}"
@@ -28,27 +29,27 @@
#This results in idempotent download-->install
action :nothing
end
- end
+ end # redhat
+
elsif platform?(%w{ ubuntu})
- deb_file="mysql-5.5.21-debian6.0-#{arch}.deb"
- Chef::Log.info("#{deb_file}")
- remote_file "/tmp/#{deb_file}" do
- source "http://www.mysql.com/get/Downloads/MySQL-5.5/#{deb_file}/from/http://mysql.llarian.net/"
- #Don't Download if its already installed
- not_if "dpkg --list | egrep -q mysql | grep 5.5"
- notifies :install, "dpkg_package[#{deb_file}]", :immediately
- #If we already downloaded it, don't download it again. Unlikely to be useful in the real world, but a time saver during dev/testing
- action :create_if_missing
- end
- dpkg_package "#{deb_file}" do
- source "/tmp/#{deb_file}"
- only_if {::File.exists?("/tmp/#{deb_file}")}
- #Action nothing seems odd at first glance. What happens is that by default we dont want to try install this.
- #Instead, if the remote_file above results in a file download, it notified this to and sets the action to install.
- #This results in idempotent download-->install
- action :nothing
- end
-end
+ # adding the mysql 5.5 ubuntu repo
+ Chef::Log.info("adding nathan's ppa for #{node['lsb']['codename']}")
+ # add the Nginx PPA; grab key from keyserver
+ apt_repository "mysql" do
+ uri "http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu"
+ distribution node['lsb']['codename']
+ components ["main"]
+ keyserver "keyserver.ubuntu.com"
+ key "C8716B42"
+ end
+
+ %w{mysql-client-5.5 mysql-server-core-5.5 mysql-server-5.5 libmysqlclient-dev}.each do |pkg|
+ package pkg do
+ action :install
+ end
+ end # ubuntu
+
+end
#Enable and Start MySQL
service "mysql" do

0 comments on commit 5b8ceda

Please sign in to comment.