From 5b286b74b0d3378a643eeb4bfae85d68af034fc5 Mon Sep 17 00:00:00 2001 From: Timor Raiman Date: Thu, 21 Nov 2013 19:54:47 +0200 Subject: [PATCH] Code review by Yoni --- vagrant/Berksfile | 4 +++- vagrant/Vagrantfile | 33 ++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/vagrant/Berksfile b/vagrant/Berksfile index 773ffdab..91560b35 100644 --- a/vagrant/Berksfile +++ b/vagrant/Berksfile @@ -1,2 +1,4 @@ -cookbook 'redash', path: '../cookbooks/redash' cookbook 'apt' +cookbook 'postgresql' +#cookbook 'redash', git: 'git@gitlab.doit9.com:ops/chef-redash.git' +cookbook 'redash', path: '../../chef-redash' diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index f60de9ee..8e762be6 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -4,30 +4,33 @@ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - - config.vm.box = "precise32" +# TODO: should be result of encryption of readable password +__pg_password = "securepass" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "ubuntu-precise-cloudimg-amd64" config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" - config.berkshelf.enabled = true - #config.omnibus.chef_version = :latest - config.omnibus.chef_version = "11.6.0" - + config.berkshelf.enabled = true + config.omnibus.chef_version = :latest + config.vm.network "forwarded_port", guest: 8888, host: 9999 config.vm.provision :chef_solo do |chef| - #Run apt-get update before anything else (specifically postgresql).. + # run apt-get update before anything else (specifically postgresql).. chef.add_recipe "apt" - chef.add_recipe "redash" chef.add_recipe "postgresql" - + chef.add_recipe "redash::redash_pg_schema" + chef.add_recipe "redash::redash" + chef.json = { - "apt" => {"compiletime" => true}, - "postgresql" => {"password" => {"postgres" => "securepass"}}, - "redash" => {"db" => {"host" => "localhost"}}, - } - + "apt" => { "compiletime" => true }, + "postgresql" => { "password" => { "postgres" => __pg_password } }, + "redash" => { "db" => { "host" => "localhost", + "user" => "postgres", + "password" => __pg_password } } + } end end