(#8193) Support new keytypes for ssh_authorized_key

Recent versions of openssh (at least openssh 5.8) support the following
keytypes in in the authorized_keys file: ecdsa-sha2-nistp256,
ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-dss or ssh-rsa.

Add support for ecdsa-sha2-nistp256, ecdsa-sha2-nistp384 and
ecdsa-sha2-nistp521.
(#8193) Support new keytypes for sshkey

Recent versions of openssh (at least openssh 5.8) support the following
keytypes in in the authorized_keys file: ecdsa-sha2-nistp256,
ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-dss or ssh-rsa.

Add support for ecdsa-sha2-nistp256, ecdsa-sha2-nistp384 and
ecdsa-sha2-nistp521.
Revert "(Maint.) Disable cleaning of storeconfigs."

This reverts commit 38801ddbd3036b45d35e48e444d1e7d566b5db47.
Fix tests for #1886 with ActiveRecord 3.x

We didn't properly call the method to test, which lead to a failing
test. However, this couldn't be properly displayed on ruby
installations with an ActiveRecord 3.x installed, as the inspect in
the `after test` part, tried to examine the table, which (obviuosly)
raised a NotConnected exception.

By calling the method the right way, we fix the test and hence also
fix the failing inspection.
(#8341) Remove duplicate loading of facter files.

If there were duplicate file paths in puppet's modulepath, fact files in
the modulepath would be loaded for every instance of the directory in
the modulepath. The resolution to this was to unique the list of fact
plugins to load.
(#8193) Add unit tests for new ssh keytypes

Add unit tests to prove that the ssh_authorized_key provider can parse
all different keytypes. This currently shows that the provider lacks
support for ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, and
ecdsa-sha2-nistp521 keys.
(#8193) Add support for new ssh keytypes in authorized_key provider

The provider now correctly detects lines that describe an
ecdsa-sha2-nistp256, ecdsa-sha2-nistp384 or ecdsa-sha2-nistp521 key.
(#10807) Use SMF's svcadm -s option to wait for errors

By default running `svcadm enable example` will start the service in the
background and won't return errors if it fails.  Using the -s option will cause
svcadm to wait and return errors back to the provider if the service cannot
start for some reason.
Updating CHANGELOG for 2.6.13rc1
Updated CHANGELOG for 2.6.13
maint: Unify 'type' and 'classref' non-terminals in the grammar

These both wrapped the CLASSREF token, except 'type' created an
AST::Type object, whereas 'classref' just extracted the string value.
This change removes the 'classref' non-terminal, replacing its uses with
'type' and explicitly extracting the string value from the AST::Type
instance.

Ideally, this should probably either retain the AST::Type object and
evaluate it where it's used, or remove the AST::Type leaf entirely, as
it has no actual behavior of its own.

Also removed some dead warnings (they were warning on a lower-case type,
which can't happen).
(#6710) Support relationship arrows between resource refs with title arrays

Previously, a relationship such as

  Notify[a,b] -> Notify[c,d]

would fail, because relationship objects didn't handle arrays of
resources, and tried to look them up as though the title array were a
single resource name. Now, relationships will be established for each
resource specified by the ref.
(#6710) Support relationships for resources defined by other constructs

This adds support for using a variable, resource ref-like string, case
statement, selector, or array/hash access for either side of a
relationship. For example, it is now legal (if unwise) to write the
following:

  notify { [a,b,c]: }
  $var = Notify[a]
  $var -> case 'x' {
    'x': {
      notify { d: }
    }
  } ~>
  'x' ? {
    'x' => Notify[b]
  } <- "Notify[c]"
(#11414) Save/execute changes on versions of Augeas < 0.3.6

Versions of Augeas prior to 0.3.6 didn't report their version number, so a
fallback of executing changes once in need_to_run? and again in execute_changes
is performed.  Otherwise a save is done in need_to_run? and this is re-used in
execute_changes.

The /augeas/events/saved node is used to tell whether the latter optimisation
happened, but the return value of #match wasn't tested correctly (it's an empty
array).
(#11414) Test Augeas versions correctly with versioncmp

The release of Augeas 0.10.0 broke simplistic version comparisons with the >=
operator, so now use versioncmp.
(#8119) Write reports to a temporary file and move them into place

When writing reports, there is a window in between opening and writing to the
report file when the report file exists as an empty file. This makes writing
report processors a little annoying as they have to deal with this case. This
writes the report into a temporary file then renames it to the report file.

Signed-off-by: Patrick Carlisle <patrick@puppetlabs.com>
Merge branch 'tickets/2.7.x/8119' into 2.7.x

* tickets/2.7.x/8119:
  (#8119) Write reports to a temporary file and move them into place
Instrumentation foundation layer

This is the base of the instrumentation layer.
The idea is to allow instrumentation of code blocks.
Each time this code is executed an event is fired to some event
listeners that in turn can do whatever is needed to perform the instrumentation.

This patch adds:
 * code instrumentation calls
 * the listener system

Listeners are added by adding a file to puppet/util/instrumentation/listeners
containing:

Puppet::Util::Instrumentation.new_listener(:my_instrumentation, pattern) do

  def notify(label, event, data)
    ... do something for data...
  end
end

It is possible to use a "pattern". The listener will be notified only
if the pattern match the label of the event.
The pattern can be a symbol, a string or a regex.
If no pattern is provided, then the listener will be notified for every
event.

The notify method will be called before and after the insturmented code
is executed, with respectively an event of :start and then :stop.

This class is thread-safe.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Add indirection (REST usable) to manipulate instrumentation

This adds two REST API:
* /instrumentation_listener(_search)/<instrumentation_name>

GET /instrumentation_listener/<instrumentation_name>
Gives details about a given instrumentation listener

GET /instrumentation_listener_search/unused
Lists all instrumentation listeners loaded in the system

PUT /instrumentation_listener/name
Allows to enable or disable a given instrumentation listener (supports
only pson). The body should be {"name":"instrumentation_name","pattern":<pattern>,"enabled":true}

DELETE /instrumentation_listener/<instrumentation_name>
This fully unsubscribe a listener

* /instrumentation_data/<instrumentation_name>
Only GET is supported. This returns the accumulated data of the given
instrumentation name if the listener supports data aggregation.
This is the only way so far to get access to the instrumentation data.
The data format is specific to the given listener.

Note: actual default auth.conf doesn't allow to interact with these
two indirections.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Add a way to add probe to puppet code

This patch contains a module (Instrumentable) that can be mixed in
various puppet classes to help define probes.

To add a probe for a given method, it is just a matter of using
the Instrumentable probe method:

class MyClass
  extend Instrumentable

  probe :thismethod
  def thismethod(arg)
  ...
  end
end

Used with no options the probe is created with a default label of
the instrumented method name and an empty dataset.

It is possible to set a given label, or use a proc as the label, in which
case the label will be the result of the evaluation of the said proc.

For instance:

class MyClass
  extend Instrumentable

  probe :thismethod, :label => Proc.new { |parent,args| args[0] }

  def thismethod(arg1, arg2)
  end
end
In this last example, the label will be the value of "arg1".
The parent argument of the :label block will contain the "self"
value of the instrumented method

When the thismethod will be called, it will in turn call the instrumentation
layer with the given label and data.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>