Sha256: 92e57e3d5d77d224a809916086e708e100d2aef62819e6e9ebea8c061e5fa986

Contents?: true

Size: 1.77 KB

Versions: 151

Compression:

Stored size: 1.77 KB

Contents

require 'puppet/face'

Puppet::Face.define(:secret_agent, '0.0.1') do
  copyright "Puppet Labs", 2011
  license   "Apache 2 license; see COPYING"

  summary "Mimics puppet agent."
  description <<-'EOT'
    This subcommand currently functions as a proof of concept, demonstrating how
    the Faces API exposes Puppet's internal systems to application logic;
    compare the actual code for puppet agent. It will eventually replace puppet
    agent entirely, and can provide a template for users who wish to implement
    agent-like functionality with non-standard application logic.
  EOT

  action(:synchronize) do
    default
    summary "Run secret_agent once."
    description <<-'EOT'
      Mimics a single run of puppet agent. This action does not currently
      daemonize, but can download plugins, submit facts, retrieve and apply a
      catalog, and submit a report to the puppet master.
    EOT
    returns <<-'EOT'
      Verbose logging from the completed run. When used from the Ruby API:
      returns a Puppet::Transaction::Report object.
    EOT
    examples <<-'EOT'
      Trigger a Puppet run with the configured puppet master:

      $ puppet secret_agent
    EOT
    notes <<-'EOT'
      This action requires that the puppet master's `auth.conf` file allow save
      access to the `facts` REST terminus. Puppet agent does not use this
      facility, and it is turned off by default. See
      <http://docs.puppetlabs.com/guides/rest_auth_conf.html> for more details.
    EOT

    when_invoked do |options|
      Puppet::Face[:plugin, '0.0.1'].download

      Puppet::Face[:facts, '0.0.1'].upload

      Puppet::Face[:catalog, '0.0.1'].download

      report  = Puppet::Face[:catalog, '0.0.1'].apply

      Puppet::Face[:report, '0.0.1'].submit(report)

      return report
    end
  end
end

Version data entries

151 entries across 151 versions & 5 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb
puppet-3.8.7 lib/puppet/face/secret_agent.rb
puppet-3.8.7-x86-mingw32 lib/puppet/face/secret_agent.rb
puppet-3.8.7-x64-mingw32 lib/puppet/face/secret_agent.rb
puppet-3.8.6 lib/puppet/face/secret_agent.rb
puppet-3.8.6-x86-mingw32 lib/puppet/face/secret_agent.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb
puppet-3.8.6-x64-mingw32 lib/puppet/face/secret_agent.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb
puppet-3.8.5 lib/puppet/face/secret_agent.rb
puppet-3.8.5-x86-mingw32 lib/puppet/face/secret_agent.rb
puppet-3.8.5-x64-mingw32 lib/puppet/face/secret_agent.rb
puppet-3.8.4 lib/puppet/face/secret_agent.rb
puppet-3.8.4-x86-mingw32 lib/puppet/face/secret_agent.rb
puppet-3.8.4-x64-mingw32 lib/puppet/face/secret_agent.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/face/secret_agent.rb