fwiw, I ended up with a small application that inherits from agent
and overrides the onetime method
This force disable reporting so it doesnt get sent to the master
and then saves the local disk in the configuration location.
require 'puppet/application'
require 'puppet/application/agent'
class Puppet::Application::Unimatrix < Puppet::Application::Agent
def onetime
unless options[:client]
$stderr.puts "onetime is specified but there is no client"
exit(43)
return
end
@daemon.set_signal_traps
begin
report = Puppet::Transaction::Report.new("unimatrix")
Puppet[:report] = false
@agent.run(:report => report)
Puppet::Util::FileLocking.writelock(Puppet[:lastrunreport], 0660) do
|file|
file.puts report.to_yaml
end
rescue => detail
puts detail.backtrace if Puppet[:trace]
Puppet.err detail.to_s
end
if not report
exit(1)
elsif options[:detailed_exitcodes] then
exit(report.exit_status)
else
exit(0)
end
end
end
----- Original Message -----
>
>
> ----- Original Message -----
> > >
> >
> > The very hacky way I can think of off hand would be setting up a
> > "report server" master on every node, and set the report server
> > setting to localhost. Now, I don't actually recommend doing this,
> > since I haven't bothered to think through the security implications
> > and how to mitigate them, but if you can think of a secure (and
> > relatively sane) way of doing it...
> >
> > It should be a lot more feasible to do as we move towards teasing
> > apart the various pieces of Puppet into independent
> > pieces/processes.
> >
>
>
> yeah, best avoided. I'd lean rather toward writing a custom
> application
> that I use rather than the normal agent. The Configurator#run
> returns
> the report so I can just do that.
>
> A face would be fine too and I did initially do this with a fact but
> I
> am not on 2.7 yet in prod
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>
--
R.I.Pienaar
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.