Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial import

  • Loading branch information...
commit 79603a4470ec96eb9d77e655bf2221264d5d8bad 0 parents
@albanpeignier authored
1  .gitignore
@@ -0,0 +1 @@
+*~
4 History.txt
@@ -0,0 +1,4 @@
+== 0.0.1 2009-01-18
+
+* 1 major enhancement:
+ * Initial release
28 Rakefile
@@ -0,0 +1,28 @@
+%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
+require File.dirname(__FILE__) + '/lib/gepetto'
+
+# Generate all the Rake tasks
+# Run 'rake -T' to see list of generated tasks (from gem root directory)
+$hoe = Hoe.new('gepetto', Gepetto::VERSION) do |p|
+ p.developer('FIXME full name', 'alban.peignier@free.fr')
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
+ p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
+ p.rubyforge_name = p.name # TODO this is default value
+ # p.extra_deps = [
+ # ['activesupport','>= 2.0.2'],
+ # ]
+ p.extra_dev_deps = [
+ ['newgem', ">= #{::Newgem::VERSION}"]
+ ]
+
+ p.clean_globs |= %w[**/.DS_Store tmp *.log]
+ path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
+ p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
+ p.rsync_args = '-av --delete --ignore-errors'
+end
+
+require 'newgem/tasks' # load /tasks/*.rake
+Dir['tasks/**/*.rake'].each { |t| load t }
+
+# TODO - want other tests/tasks run by default? Add them to the list
+# task :default => [:spec, :features]
0  app_generators/gepetto/USAGE
No changes.
30 app_generators/gepetto/gepetto_generator.rb
@@ -0,0 +1,30 @@
+require 'rbconfig'
+
+class GepettoGenerator < RubiGen::Base
+
+ def initialize(runtime_args, runtime_options = {})
+ super
+
+ usage if args.empty?
+ @destination_root = File.expand_path(args.shift)
+ end
+
+ def manifest
+ script_options = { :chmod => 0755 }
+
+ record do |m|
+ # Root directory and all subdirectories.
+ m.directory ''
+ %w{script manifests files templates}.each { |path| m.directory path }
+
+ m.template_copy_each %w( Rakefile )
+
+ m.template_copy_each %w( site.pp templates.pp nodes.pp ), 'manifests'
+
+ m.template_copy_each %w( server puppetca ), 'script', script_options
+
+ m.dependency "install_rubigen_scripts", [destination_root, "puppet"]
+ end
+ end
+
+end
1  app_generators/gepetto/templates/Rakefile
@@ -0,0 +1 @@
+Dir['tasks/**/*.rake'].each { |t| load t }
0  app_generators/gepetto/templates/manifests/nodes.pp
No changes.
0  app_generators/gepetto/templates/manifests/site.pp
No changes.
0  app_generators/gepetto/templates/manifests/templates.pp
No changes.
3  app_generators/gepetto/templates/script/puppetca
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/sbin/puppetca --ssldir $PWD/tmp/ssl $*
13 app_generators/gepetto/templates/script/server
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# create tmp if needed, other directories are created by puppetmasterd
+[ -d tmp ] || mkdir tmp
+
+# change working directories
+OPTIONS="--logdir=$PWD/log --vardir=$PWD/tmp/lib --rundir=$PWD/tmp/run --ssldir=$PWD/tmp/ssl"
+# use local files
+OPTIONS="$OPTIONS --templatedir=$PWD/templates --manifestdir=$PWD/manifests --modulepath=$PWD/modules"
+
+OPTIONS="$OPTIONS --certname=puppet --logdest=console"
+
+/usr/sbin/puppetmasterd --no-daemonize $OPTIONS $*
18 bin/gepetto
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'rubigen'
+
+if %w(-v --version).include? ARGV.first
+ require 'gepetto/version'
+ puts "#{File.basename($0)} #{Gepetto::VERSION}"
+ exit(0)
+end
+
+require 'rubigen/scripts/generate'
+RubiGen::Base.use_application_sources!
+
+RubiGen::Base.prepend_sources(
+ RubiGen::PathSource.new(:app, File.join(File.dirname(__FILE__), "..", "app_generators"))
+)
+RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'gepetto')
6 lib/gepetto.rb
@@ -0,0 +1,6 @@
+$:.unshift(File.dirname(__FILE__)) unless
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
+
+module Gepetto
+ VERSION = '0.0.1'
+end
24 puppet_generators/module/module_generator.rb
@@ -0,0 +1,24 @@
+require 'rbconfig'
+
+class ModuleGenerator < RubiGen::Base
+
+ attr_reader :module_name
+
+ def initialize(runtime_args, runtime_options = {})
+ super
+ usage if args.empty?
+ @module_name = args.shift
+ @destination_root = "modules/#{module_name}"
+ end
+
+ def manifest
+ record do |m|
+ # Root directory and all subdirectories.
+ m.directory ''
+ %w{manifests files templates}.each { |path| m.directory path }
+ m.template_copy_each %w( README )
+ m.template_copy_each %w( init.pp ), 'manifests'
+ end
+ end
+
+end
0  puppet_generators/module/templates/README
No changes.
14 script/destroy
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+begin
+ require 'rubigen'
+rescue LoadError
+ require 'rubygems'
+ require 'rubigen'
+end
+require 'rubigen/scripts/destroy'
+
+ARGV.shift if ['--help', '-h'].include?(ARGV[0])
+RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
+RubiGen::Scripts::Destroy.new.run(ARGV)
14 script/generate
@@ -0,0 +1,14 @@
+#!/usr/bin/env ruby
+APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+begin
+ require 'rubigen'
+rescue LoadError
+ require 'rubygems'
+ require 'rubigen'
+end
+require 'rubigen/scripts/generate'
+
+ARGV.shift if ['--help', '-h'].include?(ARGV[0])
+RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
+RubiGen::Scripts::Generate.new.run(ARGV)
Please sign in to comment.
Something went wrong with that request. Please try again.