Permalink
Browse files

added possibility to configure vagrant/puppet

  • Loading branch information...
1 parent a832c31 commit f8e053de860ff272991f77ad77ef0565d8485e2d @tsteur tsteur committed Aug 29, 2012
Showing with 63 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +5 −3 puppet/site.pp
  3. +20 −1 vagrant/precise32/Vagrantfile
  4. +23 −3 vagrant/precise64/Vagrantfile
  5. +9 −0 vagrantconfig.yaml
  6. +5 −0 vagrantconfig_local.yaml-dist
View
@@ -0,0 +1 @@
+vagrantconfig_local.yaml
View
@@ -4,11 +4,13 @@
class { 'piwik':
directory => '/var/www/piwik',
- repository => 'svn',
+ repository => $repository,
version => 'trunk',
- db_user => 'piwik@localhost',
- db_password => 'secure',
+ db_user => $db_username,
+ db_password => $db_password,
log_analytics => true,
+ svn_username => $svn_username,
+ svn_password => $svn_password,
}
piwik::apache { 'apache.piwik':
@@ -1,6 +1,18 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
+require "yaml"
+
+_config = YAML.load(File.open(File.join(File.dirname(__FILE__), "../../vagrantconfig.yaml"), File::RDONLY).read)
+
+begin
+ _config.merge!(YAML.load(File.open(File.join(File.dirname(__FILE__), "../../vagrantconfig_local.yaml"), File::RDONLY).read))
+rescue Errno::ENOENT
+
+end
+
+CONF = _config
+
Vagrant::Config.run do |config|
config.vm.box = "precise32"
@@ -11,7 +23,14 @@ Vagrant::Config.run do |config|
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "../../puppet"
puppet.manifest_file = "site.pp"
- puppet.module_path = "../../puppet/modules"
+ puppet.module_path = "../../puppet/modules"
+ puppet.facter = [
+ ['db_username', CONF['db_username']],
+ ['db_password', CONF['db_password']],
+ ['repository', CONF['repository']],
+ ['svn_username', CONF['svn_password']],
+ ['svn_password', CONF['svn_password']],
+ ]
end
end
@@ -1,16 +1,36 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
+require "yaml"
+
+_config = YAML.load(File.open(File.join(File.dirname(__FILE__), "../../vagrantconfig.yaml"), File::RDONLY).read)
+
+begin
+ _config.merge!(YAML.load(File.open(File.join(File.dirname(__FILE__), "../../vagrantconfig_local.yaml"), File::RDONLY).read))
+rescue Errno::ENOENT
+
+end
+
+CONF = _config
+
Vagrant::Config.run do |config|
- config.vm.box = "precise64"
+ config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :hostonly, "192.168.33.10"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "../../puppet"
puppet.manifest_file = "site.pp"
- puppet.module_path = "../../puppet/modules"
+ puppet.module_path = "../../puppet/modules"
+ puppet.facter = [
+ ['db_username', CONF['db_username']],
+ ['db_password', CONF['db_password']],
+ ['repository', CONF['repository']],
+ ['svn_username', CONF['svn_password']],
+ ['svn_password', CONF['svn_password']],
+ ]
+
end
-end
+end
View
@@ -0,0 +1,9 @@
+# Don't change this config!
+
+# Use vagrantconfig_local.yaml to override these settings instead.
+
+db_password: secure
+db_username: piwik@localhost
+repository: svn
+svn_username: false
+svn_password: false
@@ -0,0 +1,5 @@
+# local configuration
+
+# password is used for root user as well
+db_password: secure
+db_username: piwik@localhost

0 comments on commit f8e053d

Please sign in to comment.