Permalink
Browse files

Proof of Concept on Vagrant support. Level 2 & 5 can be started and run.

  • Loading branch information...
1 parent 00b35a7 commit 6ffcf1d0e45df6844211922d27e4eda1336ee416 @e28eta committed Feb 6, 2013
Showing with 131 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +25 −0 Vagrantfile
  3. +59 −0 puppet/manifests/level02.pp
  4. +46 −0 puppet/manifests/level05.pp
View
@@ -0,0 +1 @@
+.vagrant
View
@@ -0,0 +1,25 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant::Config.run do |config|
+ config.vm.box = "lucid32"
+ # config.vm.box_url = "http://domain.com/path/to/above.box"
+
+ config.vm.define :level2 do |level2_config|
+ level2_config.vm.network :hostonly, "192.168.33.102"
+
+ level2_config.vm.provision :puppet do |puppet|
+ puppet.manifests_path = "puppet/manifests"
+ puppet.manifest_file = "level02.pp"
+ end
+ end
+
+ config.vm.define :level5 do |level5_config|
+ level5_config.vm.network :hostonly, "192.168.33.105"
+
+ level5_config.vm.provision :puppet do |puppet|
+ puppet.manifests_path = "puppet/manifests"
+ puppet.manifest_file = "level05.pp"
+ end
+ end
+end
@@ -0,0 +1,59 @@
+exec { "apt-update":
+ command => "/usr/bin/apt-get update"
+}
+
+Exec["apt-update"] -> Package <| |>
+
+package {'apache2':
+ ensure => 'latest',
+}
+
+package {'libapache2-mod-php5':
+ ensure => 'latest',
+ require => Package['apache2'],
+ notify => Service['apache2']
+}
+
+service {'apache2':
+ ensure => 'running',
+ enable => true,
+ require => Package['libapache2-mod-php5'],
+}
+
+file {'/var/www':
+ ensure => 'directory',
+ mode => '0755',
+ owner => 'www-data',
+ group => 'www-data',
+}
+
+file {'/var/www/index.html':
+ ensure => 'absent',
+ require => Package['apache2'],
+}
+
+file {'/var/www/index.php':
+ ensure => 'present',
+ source => '/vagrant/levels/2/index.php',
+ mode => '0555',
+ owner => 'www-data',
+ group => 'www-data',
+ require => File['/var/www'],
+}
+
+file {'/var/www/password.txt':
+ ensure => 'present',
+ content => 'lvl2Pasword!',
+ mode => '0333',
+ owner => 'www-data',
+ group => 'www-data',
+ require => File['/var/www'],
+}
+
+file {'/var/www/uploads':
+ ensure => 'directory',
+ mode => '0777',
+ owner => 'www-data',
+ group => 'www-data',
+ require => File['/var/www'],
+}
@@ -0,0 +1,46 @@
+package { 'bundler':
+ ensure => 'latest',
+ provider => 'gem',
+}
+
+file {'/level5':
+ ensure => 'directory',
+}
+
+file {'/level5/production':
+ ensure => 'present',
+ content => '',
+}
+
+file {'/level5/srv.rb':
+ ensure => 'present',
+ source => '/vagrant/levels/5/srv.rb',
+}
+
+file {'/level5/Gemfile':
+ ensure => 'present',
+ source => '/vagrant/levels/5/Gemfile',
+}
+
+file {'/level5/Gemfile.lock':
+ ensure => 'present',
+ source => '/vagrant/levels/5/Gemfile.lock',
+}
+
+file {'/level5/password.txt':
+ ensure => 'present',
+ content => 'some-password',
+}
+
+service {'srv.rb':
+ ensure => 'running',
+ start => 'cd /level5 && bundle install && ./srv.rb &',
+ provider => 'base',
+}
+
+host {'level05-1.stripe-ctf.com':
+ ip => '192.168.33.105',
+}
+host {'level02-1.stripe-ctf.com':
+ ip => '192.168.33.102',
+}

0 comments on commit 6ffcf1d

Please sign in to comment.