Skip to content
Browse files

Adding Level 6

  • Loading branch information...
1 parent f68b4d0 commit ca5b30f1ebaddf969d3c96fdb058bfb568b86501 @e28eta committed Feb 13, 2013
Showing with 75 additions and 1 deletion.
  1. +3 −1 Vagrantfile
  2. +65 −0 puppet/modules/stripectf2/manifests/level06.pp
  3. +7 −0 puppet/nodes/level06.pp
View
4 Vagrantfile
@@ -23,7 +23,9 @@ Vagrant::Config.run do |config|
config.vm.define :level5 do |box_config|
configure(box_config, "5")
end
-
+ config.vm.define :level6 do |box_config|
+ configure(box_config, "6")
+ end
config.vm.define :level8 do |box_config|
configure(box_config, "8")
end
View
65 puppet/modules/stripectf2/manifests/level06.pp
@@ -0,0 +1,65 @@
+class stripectf2::level06 (
+ $destination,
+ $source,
+) {
+ file {$destination:
+ ensure => 'directory',
+ recurse => true,
+ mode => '0755',
+ owner => 'vagrant',
+ group => 'vagrant',
+ source => $source,
+ }
+
+ file {"${destination}/password.txt":
+ content => "\"Congrats!\" I'd say", # Need a pw with " and '
+ require => File[$destination],
+ }
+
+ /* srv.rb says this is needed for production, but it doesn't look like it
+ file {"${destination}/url_root.txt":
+ content => "http://${fqdn}",
+ require => File[$destination],
+ }
+ */
+
+ service {'srv.rb':
+ ensure => 'running',
+ start => "cd ${destination} && bundle install && bundle exec ./srv.rb &",
+ provider => 'base',
+ require => File["${destination}/password.txt"],
+ }
+
+ cron {'casperjs':
+ command => "cd ${destination} && /usr/local/bin/casperjs browser.coffee http://localhost:4567",
+ minute => '*',
+ environment => "PATH=/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/vagrant_ruby/bin",
+ user => 'vagrant',
+ }
+
+ service {'apache2':
+ ensure => 'running',
+ enable => true,
+ hasrestart => true,
+ }
+
+ # Disable the default apache2 site
+ stripectf2::apache2_site {'000-default':
+ ensure => 'absent',
+ }
+
+ stripectf2::apache2_module {['proxy', 'proxy_http']:
+ ensure => 'present',
+ }
+
+ $proxy_url = "http://127.0.0.1:4567/"
+ file {'/etc/apache2/sites-available/level06':
+ content => template('stripectf2/apache2_site_config.erb'),
+ notify => Service['apache2'],
+ }
+
+ stripectf2::apache2_site {'level06':
+ ensure => 'present',
+ require => File['/etc/apache2/sites-available/level06'],
+ }
+}
View
7 puppet/nodes/level06.pp
@@ -0,0 +1,7 @@
+node 'level06-1.stripe-ctf.com' {
+ class {'stripectf2::level06':
+ destination => '/levels/06',
+ source => '/vagrant/levels/6',
+ require => File['/levels'],
+ }
+}

0 comments on commit ca5b30f

Please sign in to comment.
Something went wrong with that request. Please try again.