Sha256: 7c7662de91a30a2b2a65150ee9a3662b58e2bd778eb73e33d52a8356f018c605

Contents?: true

Size: 1012 Bytes

Versions: 6

Compression:

Stored size: 1012 Bytes

Contents

require 'puppet/agent/runner'

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::Agent::Runner.new(options)

            runner.run

            return runner.status
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-0.25.5 lib/puppet/network/handler/runner.rb
puppet-0.25.4 lib/puppet/network/handler/runner.rb
puppet-0.25.3 lib/puppet/network/handler/runner.rb
puppet-0.25.2 lib/puppet/network/handler/runner.rb
puppet-0.25.1 lib/puppet/network/handler/runner.rb
puppet-0.25.0 lib/puppet/network/handler/runner.rb