From c393a557a0c3666c4b9a68ef824a8805c5e72559 Mon Sep 17 00:00:00 2001 From: Eric Teubert Date: Sat, 17 Dec 2011 12:21:49 +0100 Subject: [PATCH] modernizations - always fetch lates WordPress version - skip checksum - add rake task :setup to install my custom shell --- Rakefile | 19 ++++++++++++ Vagrantfile | 35 +++++++++-------------- cookbooks/wordpress/attributes/default.rb | 4 +-- cookbooks/wordpress/recipes/default.rb | 2 +- 4 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 Rakefile diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..ffba16a --- /dev/null +++ b/Rakefile @@ -0,0 +1,19 @@ +require "vagrant" + +task :setup do + env = Vagrant::Environment.new + raise "Must run `vagrant up`" if !env.primary_vm.created? + raise "Must be running!" if !env.primary_vm.vm.running? + + env.primary_vm.ssh.execute do |ssh| + ssh.exec! "export LC_ALL=en_US.UTF-8" + ssh.exec! "git clone git://github.com/eteubert/dotfiles.git" + ssh.exec! "sudo gem install rake" + + puts "\nNow do the following to finish the setup:" + puts "vagrant ssh" + puts "go to ~/dotfiles and type `rake install` to setup dotfiles" + puts "sudo chsh -s /usr/bin/zsh vagrant" + puts "sudo reboot" + end +end diff --git a/Vagrantfile b/Vagrantfile index 962875d..243c85c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -40,26 +40,19 @@ Vagrant::Config.run do |config| chef.add_recipe "apt" chef.add_recipe "wordpress" - chef.json.merge!( - "mysql" => { - "server_root_password" => "", - "allow_remote_root" => true - }, - - "wordpress" => { - "db" => { - "database" => "wordpress", - "user" => "wordpress", - "password" => "wordpress" - } - } - ) - - # das wäre noch nett anschließend auszuführen: - # export LC_ALL=en_US.UTF-8 - # git clone git://github.com/eteubert/dotfiles.git - # notice: "go to ~/dotfiles and type `rake install` to setup dotfiles" - # sudo chsh -s /usr/bin/zsh vagrant - # sudo reboot + # chef.json.merge!( + # :mysql => { + # :server_root_password => "", + # :allow_remote_root => true + # }, + # + # :wordpress => { + # :db => { + # :database => "wordpress", + # :user => "wordpress", + # :password => "wordpress" + # } + # } + # ) end end diff --git a/cookbooks/wordpress/attributes/default.rb b/cookbooks/wordpress/attributes/default.rb index 3db1d8b..6340259 100644 --- a/cookbooks/wordpress/attributes/default.rb +++ b/cookbooks/wordpress/attributes/default.rb @@ -19,8 +19,8 @@ # # General settings -default['wordpress']['version'] = "3.1.2" -default['wordpress']['checksum'] = "1006a1bb97b42381ad82490d00d9b7fb9f7a1c9d83ee2ed36935a9eb99c81064" +default['wordpress']['version'] = "latest" +# default['wordpress']['checksum'] = "1006a1bb97b42381ad82490d00d9b7fb9f7a1c9d83ee2ed36935a9eb99c81064" default['wordpress']['dir'] = "/var/www/wordpress" default['wordpress']['db']['database'] = "wordpressdb" default['wordpress']['db']['user'] = "wordpressuser" diff --git a/cookbooks/wordpress/recipes/default.rb b/cookbooks/wordpress/recipes/default.rb index 7156202..a5811ec 100644 --- a/cookbooks/wordpress/recipes/default.rb +++ b/cookbooks/wordpress/recipes/default.rb @@ -36,7 +36,7 @@ node.set['wordpress']['keys']['logged_in'] = secure_password node.set['wordpress']['keys']['nonce'] = secure_password remote_file "#{Chef::Config[:file_cache_path]}/wordpress-#{node['wordpress']['version']}.tar.gz" do - checksum node['wordpress']['checksum'] + # checksum node['wordpress']['checksum'] source "http://wordpress.org/wordpress-#{node['wordpress']['version']}.tar.gz" mode "0644" end