Permalink
Browse files

base box definition and puppet files

  • Loading branch information...
0 parents commit 06957f3818be7de81ced766a6a8e2692f273dfc9 @amaia committed Sep 1, 2012
Showing with 108 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +9 −0 .gitmodules
  3. +11 −0 Vagrantfile
  4. +84 −0 puppet/manifests/default.pp
  5. 0 puppet/modules/.gitkeep
  6. +1 −0 puppet/modules/mysql
  7. +1 −0 puppet/modules/postgresql
  8. +1 −0 puppet/modules/rvm
1 .gitignore
@@ -0,0 +1 @@
+.vagrant
9 .gitmodules
@@ -0,0 +1,9 @@
+[submodule "puppet/modules/mysql"]
+ path = puppet/modules/mysql
+ url = git://github.com/puppetlabs/puppetlabs-mysql.git
+[submodule "puppet/modules/postgresql"]
+ path = puppet/modules/postgresql
+ url = git://github.com/akumria/puppet-postgresql.git
+[submodule "puppet/modules/rvm"]
+ path = puppet/modules/rvm
+ url = git://github.com/blt04/puppet-rvm.git
11 Vagrantfile
@@ -0,0 +1,11 @@
+Vagrant::Config.run do |config|
+ config.vm.box = 'precise32'
+ config.vm.box_url = 'http://files.vagrantup.com/precise32.box'
+ config.vm.host_name = 'rails-starter-box'
+
+ config.vm.forward_port 3000, 3000
+
+ config.vm.provision :puppet,
+ :manifests_path => 'puppet/manifests',
+ :module_path => 'puppet/modules'
+end
84 puppet/manifests/default.pp
@@ -0,0 +1,84 @@
+# Make sure apt-get -y update runs before anything else.
+stage { 'preinstall':
+ before => Stage['main']
+}
+
+class apt_get_update {
+ exec { '/usr/bin/apt-get -y update':
+ user => 'root'
+ }
+}
+class { 'apt_get_update':
+ stage => preinstall
+}
+
+package { [ 'build-essential',
+'zlib1g-dev',
+'libssl-dev',
+'libreadline-dev',
+'git-core',
+'libxml2',
+'libxml2-dev',
+'libxslt1-dev',
+'sqlite3',
+'libsqlite3-dev']:
+ensure => installed,
+}
+
+class install_mysql {
+ class { 'mysql': }
+
+ class { 'mysql::server':
+ config_hash => { 'root_password' => '' }
+ }
+
+ package { 'libmysqlclient15-dev':
+ ensure => installed
+ }
+}
+class { 'install_mysql': }
+
+class install_postgres {
+ class { 'postgresql': }
+
+ class { 'postgresql::server': }
+
+ pg_user { 'vagrant':
+ ensure => present,
+ superuser => true,
+ require => Class['postgresql::server']
+ }
+
+ package { 'libpq-dev':
+ ensure => installed
+ }
+}
+class { 'install_postgres': }
+
+
+
+class install-rvm {
+ include rvm
+ rvm::system_user { vagrant: ; }
+
+ rvm_system_ruby {
+ 'ruby-1.9.3-p194':
+ ensure => 'present',
+ default_use => false;
+ 'ruby-1.8.7-p370':
+ ensure => 'present',
+ default_use => false;
+ }
+
+ rvm_gem {
+ 'ruby-1.9.3-p194/bundler': ensure => latest;
+ 'ruby-1.9.3-p194/rails': ensure => latest;
+ 'ruby-1.9.3-p194/rake': ensure => latest;
+ 'ruby-1.8.7-p370/bundler': ensure => latest;
+ 'ruby-1.8.7-p370/rails': ensure => latest;
+ 'ruby-1.8.7-p370/rake': ensure => latest;
+ }
+
+}
+
+class { 'install-rvm': }
0 puppet/modules/.gitkeep
No changes.
1 puppet/modules/mysql
@@ -0,0 +1 @@
+Subproject commit 0e4de09934be505ede1acc6232c1519a8715c6f1
1 puppet/modules/postgresql
@@ -0,0 +1 @@
+Subproject commit 69157d63b515e531048b217294d91b3a373cb601
1 puppet/modules/rvm
@@ -0,0 +1 @@
+Subproject commit e07e606f10f408a9bf810c44ee5baaaa6fadd803

0 comments on commit 06957f3

Please sign in to comment.