Revert "Revert "Merge branch 'stschulte-ticket/master/11675_implement_expiry_retrieve'""

This reverts commit 3f96ecdc6dec2bb724cb60a36970f6199757e42a.

The original commit series around issue 11675 have been reverted because
they caused test failures and the policy is to revert such commits.

Restore the commit series to be able to fix the failing tests.
(#11675) Fix test failures in ruby 1.8.7

The spec tests for the Puppet::Type.addcmd method failed on ruby 1.8.7.

The addcmd method builds a commandline to execute `useradd` with
appropiate command line arguments. To build the commandline
`add_properties` gets called which in turn calls
`Puppet::Type.validproperties`. The order in which properties are returned
can be considered undefinied so the whole `useradd` commandline can include
arguments in random order. While the randomness does not make a difference for
the useradd executable it causes spec failures on some systems.

Sort the properties when building the useradd commandline. This way the
result is consistent across all ruby versions and easier to test.
Merge branch 'stschulte-ticket/master/fixup_expiry'

* stschulte-ticket/master/fixup_expiry:
  (#11675) Fix test failures in ruby 1.8.7
  Revert "Revert "Merge branch 'stschulte-ticket/master/11675_implement_expiry_retrieve'""