Skip to content

Instantly share code, notes, and snippets.

@cheeseplus
Created November 1, 2012 01:52
Show Gist options
  • Save cheeseplus/3991134 to your computer and use it in GitHub Desktop.
Save cheeseplus/3991134 to your computer and use it in GitHub Desktop.
#
# Cookbook Name:: txsilc
# Recipe:: default
require 'fileutils'
# check if symlink exists
ruby_block "symlink-wordpress" do
block do
FileUtils.rm_rf "/var/www" if File.exists? "/var/www"
FileUtils.symlink "/vagrant/wordpress", "/var/www"
end
action :create
end
gem_package "mysql" do
action :install
end
# create a mysql database
mysql_database 'txsilc_local' do
connection ({:host => "localhost", :username => 'root', :password => node['mysql']['server_root_password']})
action [ :drop, :create ]
end
# Run apt-get update to create the stamp file
execute "mysql-import" do
command "mysql -u root -ppoop -h localhost txsilc_local < /vagrant/db/txsilc_local_2012-10-18.sql"
end
# # Run apt-get update to create the stamp file
# execute "symlink-wordpress" do
# command "sudo ln -s /vagrant/wordpress/ wordpress"
# action :nothing
# end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment