Sha256: a39e048a3a4cea22d5b3add4563a8a46251878d621dd14641f119beceb6383e3

Contents?: true

Size: 955 Bytes

Versions: 45

Compression:

Stored size: 955 Bytes

Contents

require 'puppet/run'
require 'puppet/network/handler'
require 'xmlrpc/server'

class Puppet::Network::Handler
  class MissingMasterError < RuntimeError; end # Cannot find the master client
  # A simple server for triggering a new run on a Puppet client.
  class Runner < Handler
    desc "An interface for triggering client configuration runs."

    @interface = XMLRPC::Service::Interface.new("puppetrunner") { |iface|
      iface.add_method("string run(string, string)")
    }

    side :client

    # Run the client configuration right now, optionally specifying
    # tags and whether to ignore schedules
    def run(tags = nil, ignoreschedules = false, fg = true, client = nil, clientip = nil)
      options = {}
      options[:tags] = tags if tags
      options[:ignoreschedules] = ignoreschedules if ignoreschedules
      options[:background] = !fg

      runner = Puppet::Run.new(options)

      runner.run

      runner.status
    end
  end
end

Version data entries

45 entries across 45 versions & 4 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/network/handler/runner.rb
puppet-parse-0.1.3 lib/vendor/puppet/network/handler/runner.rb
puppet-parse-0.1.2 lib/vendor/puppet/network/handler/runner.rb
puppet-parse-0.1.1 lib/vendor/puppet/network/handler/runner.rb
puppet-2.7.26 lib/puppet/network/handler/runner.rb
puppet-2.7.25 lib/puppet/network/handler/runner.rb
puppet-2.7.24 lib/puppet/network/handler/runner.rb
puppet-2.7.23 lib/puppet/network/handler/runner.rb
puppet-2.7.22 lib/puppet/network/handler/runner.rb
puppet-parse-0.1.0 lib/vendor/puppet/network/handler/runner.rb
puppet-parse-0.0.6 lib/vendor/puppet/network/handler/runner.rb
puppet-2.7.21 lib/puppet/network/handler/runner.rb
puppet-2.6.18 lib/puppet/network/handler/runner.rb
puppet-parse-0.0.5 lib/vendor/puppet/network/handler/runner.rb
puppet-parse-0.0.4 lib/vendor/puppet/network/handler/runner.rb
puppet-parse-0.0.2 lib/vendor/puppet/network/handler/runner.rb
puppet-2.7.20 lib/puppet/network/handler/runner.rb
puppet-2.7.20.rc1 lib/puppet/network/handler/runner.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/lib/puppet/network/handler/runner.rb
puppet-2.7.19 lib/puppet/network/handler/runner.rb