stringup-puppet 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/bin/stringup +32 -0
  2. metadata +46 -0
data/bin/stringup ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require "rubygems"
5
+ require "puppet"
6
+ require "facter"
7
+ require "fileutils"
8
+ require "optparse"
9
+
10
+ options = OptionParser.new do |opt|
11
+ opt.banner = "USAGE: stringup {-h} run"
12
+ opt.on("-h", "--help", "help") do
13
+ puts options
14
+ exit
15
+ end
16
+ end
17
+
18
+ options.parse!
19
+
20
+ FileUtils.mkdir_p("#{ENV['HOME']}/.puppet/manifests") unless File.exists?("#{ENV['HOME']}/.puppet/manifests")
21
+ FileUtils.mkdir_p("#{ENV['HOME']}/.puppet/modules") unless File.exists?("#{ENV['HOME']}/.puppet/modules")
22
+
23
+ manifest = ARGV[0].nil? ? "default.pp" : "#{ARGV[0]}.pp"
24
+
25
+ system("puppet apply #{ENV['HOME']}/.puppet/manifests/#{manifest} --modulepath=#{ENV['HOME']}/.puppet/modules")
26
+
27
+ rescue LoadError => e
28
+ puts e.message
29
+ puts "You don't have Puppet installed. Installing it now."
30
+ sudo = File.writable?(%x[gem environment| grep "INSTALLATION DIRECTORY"| awk -F':' '{print $2}'].strip) ? "" : "sudo "
31
+ system("#{sudo} gem install puppet facter --no-ri --no-rdoc")
32
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stringup-puppet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sam Kottler
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-19 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: A simple tool to help manage workstations with Puppet
15
+ email: sam@kottlerdevelopment.com
16
+ executables:
17
+ - stringup
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/stringup
22
+ homepage: http://github.com/skottler/stringup
23
+ licenses: []
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 1.8.24
43
+ signing_key:
44
+ specification_version: 3
45
+ summary: Manage workstations with Puppet
46
+ test_files: []