-# Parameters:
-# The parameters listed here are not required in general and were
-# added for use cases related to development environments.
-# disable_keys - disables the requirement for all packages to be signed
-# always_apt_update - rather apt should be updated on every run (intended
-# for development environments where package updates are frequent
-# purge_sources_list - Accepts true or false. Defaults to false If set to
-# true, Puppet will purge all unmanaged entries from sources.list"
-# purge_sources_list_d - Accepts true or false. Defaults to false. If set
-# to true, Puppet will purge all unmanaged entries from sources.list.d
-#
-# Actions:
-#
-# Requires:
-# puppetlabs/stdlib
-# Sample Usage:
-# class { 'apt': }
+class apt (
+ Hash $update_defaults = $apt::params::update_defaults,
+ Hash $purge_defaults = $apt::params::purge_defaults,
+ Hash $proxy_defaults = $apt::params::proxy_defaults,
+ Hash $include_defaults = $apt::params::include_defaults,
+ String $provider = $apt::params::provider,
+ String $keyserver = $apt::params::keyserver,
+ Optional[String] $ppa_options = $apt::params::ppa_options,
+ Optional[String] $ppa_package = $apt::params::ppa_package,
+ Optional[Hash] $backports = $apt::params::backports,
+ Hash $confs = $apt::params::confs,
+ Hash $update = $apt::params::update,
+ Hash $purge = $apt::params::purge,
+ Hash $proxy = $apt::params::proxy,
+ Hash $sources = $apt::params::sources,
+ Hash $keys = $apt::params::keys,
+ Hash $ppas = $apt::params::ppas,
+ Hash $pins = $apt::params::pins,
+ Hash $settings = $apt::params::settings,
+ String $root = $apt::params::root,
+ String $sources_list = $apt::params::sources_list,
+ String $sources_list_d = $apt::params::sources_list_d,
+ String $conf_d = $apt::params::conf_d,
+ String $preferences = $apt::params::preferences,
+ String $preferences_d = $apt::params::preferences_d,
+ Hash $config_files = $apt::params::config_files,
+ Hash $source_key_defaults = $apt::params::source_key_defaults
+) inherits apt::params {
+
+ if $facts['osfamily'] != 'Debian' {
+ fail('This module only works on Debian or derivatives like Ubuntu')
+ }
+
+ if $update['frequency'] {
+ assert_type(
+ Enum['always','daily','weekly','reluctantly'],
+ $update['frequency'],
+ )
+ }
+ if $update['timeout'] {
+ assert_type(Integer, $update['timeout'])
+ }
+ if $update['tries'] {
+ assert_type(Integer, $update['tries'])
+ }
+
+ $_update = merge($::apt::update_defaults, $update)
+ include ::apt::update
+
+ if $purge['sources.list'] {
+ assert_type(Boolean, $purge['sources.list'])
+ }
+ if $purge['sources.list.d'] {
+ assert_type(Boolean, $purge['sources.list.d'])
+ }
+ if $purge['preferences'] {
+ assert_type(Boolean, $purge['preferences'])
+ }
+ if $purge['preferences.d'] {
+ assert_type(Boolean, $purge['preferences.d'])
+ }