Permalink
Browse files

Using awk to comment out south. Use vagrant command from subdir

  • Loading branch information...
mkcode committed Jul 24, 2012
1 parent f0c164e commit 37532e54b3e833044779460d34b9d2b967f46d74
Showing with 15 additions and 7 deletions.
  1. +1 −2 Vagrantfile
  2. +14 −5 cookbooks/main/recipes/lernanta.rb
View
@@ -74,15 +74,14 @@ Vagrant::Config.run do |config|
# Enable provisioning with chef solo, specifying a cookbooks path (relative
# to this Vagrantfile), and adding some recipes and/or roles.
- #
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "main"
# chef.add_role "web"
# You may also specify custom JSON attributes:
# chef.json = { :mysql_password => "foo" }
- chef.json.merge! JSON.parse(File.read("./node.json"))
+ chef.json.merge! JSON.parse(File.read(File.join(File.dirname(File.expand_path(__FILE__)), 'node.json')))
end
# Enable provisioning with chef server, specifying the chef server URL,
@@ -91,6 +91,7 @@
node[:secret_key] = secret_key
template "/opt/lernanta/lernanta/settings_local.py" do
+ action :create_if_missing
source "settings_local.py"
mode 0644
user "p2pu"
@@ -99,11 +100,19 @@
:secret_key => node[:secret_key] })
end
-template "/opt/lernanta/lernanta/settings.py" do
- source "settings.py"
- mode 0644
- user "p2pu"
- group "p2pu"
+# Forget about the settings file for now. We only need to change settings_local.py
+# template "/opt/lernanta/lernanta/settings.py" do
+# source "settings.py"
+# mode 0644
+# user "p2pu"
+# group "p2pu"
+# end
+
+# To run the dbsync we need to comment out south
+bash "Updating settings.py for south" do
+ code <<-EOH
+ sed -i -e "s/'south',/#'south',/" /opt/lernanta/lernanta/settings.py
+ EOH
end
bash "Make Database" do

0 comments on commit 37532e5

Please sign in to comment.