Sha256: 347e232041fb8cba8f882046417a0a523a379e3d4c1c633ac994073776372f68

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'
$LOAD_PATH << "#{File.dirname(__FILE__)}/../lib"
require 'runpuppet'

options = {}

OptionParser.new do |opts|
  opts.banner = <<BANNER
Runpuppet for puppet_controller

Usage:
    runpuppet # runs forced puppetrun
    runpuppet --try # runs only if told by puppet_controller
    runpuppet --branch feature # run a non-default branch
    runpuppet --facts # report facter facts to puppet_controller
Options:
BANNER

  opts.on("-h", "--help","Show this.") { puts opts; exit }
  opts.on("--readme", 'Show Readme'){ puts File.read(File.join(File.dirname(__FILE__), '..', 'README.md')); exit }
  opts.on('--version', 'Show Version'){ puts Runpuppet::VERSION; exit}
  opts.on('--try', 'Runs only if selected on puppet_controller'){ options[:try] = true }
  opts.on('-f', '--facts', 'Report facts'){ options[:facts] = true }
  opts.on('-v', '--verbose', 'Execute Verbose Command'){ options[:verbose] = true }
  opts.on('-d', '--debug', 'With debug output'){ options[:debug] = true }
  opts.on('-b x', '--branch x', 'Run this branch') do |branch|
    options[:branch] = branch
  end
end.parse!

PuppetContext = Runpuppet.setup_context(options)
if options[:facts]
  PuppetContext.client.report_facts
else
  PuppetContext.client.run
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
runpuppet-1.0.2 bin/runpuppet
runpuppet-1.0.1 bin/runpuppet
runpuppet-1.0.0 bin/runpuppet