Skip to content

Instantly share code, notes, and snippets.

@1000k
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save 1000k/d25b2ea0a37346f17fa1 to your computer and use it in GitHub Desktop.

Select an option

Save 1000k/d25b2ea0a37346f17fa1 to your computer and use it in GitHub Desktop.
Enable official MySQL reporisoty & install MySQL Community Server using Chef. ref: http://dev.mysql.com/doc/mysql-repo-excerpt/5.6/en/linux-installation-yum-repo.html
# mysql_1000k/recipes/client.rb
# Install MySQL Client.
include_recipe 'mysql_1000k::mysql_repo'
yum_package 'mysql-community-client'
# mysql_1000k/recipes/mysql_repo.rb
rpm_path = "#{Chef::Config[:file_cache_path]}/mysql-repo.rpm"
remote_file rpm_path do
source 'http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm'
action :create_if_missing
end
yum_package 'install-mysql-repository' do
package_name 'mysql-community-release'
source rpm_path
end
# mysql_1000k/recipes/server.rb
# Install MySQL Server.
include_recipe 'mysql_1000k::mysql_repo'
yum_package 'mysql-community-server'
service 'mysqld' do
supports [:restart, :reload, :status]
action [ :enable, :start ]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment