when updating or installing newer packages with apt::force and you have changed previous
configuration files aptitude or apt-get will prompt what to do. You can suppress that
by pre-define the action with cfg_files parameter (new, old or unchanged and its backward
compatible if not defined). With a second optional parameter cfg_missing you can force
your provider to install missing configuration files as well.
Signed-off-by: Martin Seener <martin@seener.de>
apt::force: Changed selectors used in force.pp to case statements; refs #module-1306
Signed-off-by: Martin Seener <martin@seener.de>
apt::force: rspec: fixed the failing tests and added validate_re for cfg_files and validate_bool for cfg_missing. Also removed default values for both case statements and only allow pre-defined values or true/false. Furthermore enhanced the README refs #module-1306
Was able to fix the failing rspec tests for the patch.
Thanks to Morgan Haskel.
Signed-off-by: Martin Seener <martin@seener.de>
Despite the puppetlabs-stdlib documentation says validation_re supports 3 arguments the tests failed telling that only 2 are supported. Fixed this by removing the 3 optional argument; refs #modules-1306
Signed-off-by: Martin Seener <martin.seener@barzahlen.de>
apt::force: updated readme refs #module-1306
Signed-off-by: Martin Seener <martin@seener.de>
The hash passing to the with method is cleaner and closer to puppet code, so
all of the with_$param have been replaced with with($hash). This also
includes two minor whitspace changes to unstable.pp and source.pp.
This also replaces the ternary switch on param_set with a hash merge,
which is cleaner and will support more use cases.
This commit adds full coverage for the apt module as it currently exists. It
adds rspec-puppet tests for the defines (apt::builddep, apt::force, apt::pin,
apt::ppa, apt::source) and classes (apt, debian::testing, debian::unstable,
apt::params, apt::release).
Previously, even if $version were passed to apt::force, aptitude would just
install the default version of the package available. This updates the aptitude
call to use the version string if it exists. If no version is passed, or if it
is false, no version is added to the aptitude call. This also updates the
rspec-puppet tests for the define, to reflect the changes to the exec.
In the Previous commits, the query being done by the
apt::force install command was not strict enough and
could lead to false positives.
These queries represented by the unless parameter have been
resolved in another commit. This commit accompanies that commit
and adds basic unit tests to correspond to the changes.