- if ($pin != false) {
- # Get the host portion out of the url so we can pin to origin
- $url_split = split($location, '/')
- $host = $url_split[2]
+ if $key {
+ if $key =~ Hash {
+ unless $key['id'] {
+ fail('key hash must contain at least an id entry')
+ }
+ $_key = merge($::apt::source_key_defaults, $key)
+ } else {
+ $_key = { 'id' => assert_type(String[1], $key) }
+ }
+ }
+
+ $header = epp('apt/_header.epp')
+
+ $sourcelist = epp('apt/source.list.epp', {
+ 'comment' => $comment,
+ 'includes' => $includes,
+ 'opt_architecture' => $architecture,
+ 'allow_unsigned' => $allow_unsigned,
+ 'location' => $location,
+ 'release' => $_release,
+ 'repos' => $repos,
+ })
+
+ apt::setting { "list-${name}":
+ ensure => $ensure,
+ content => "${header}${sourcelist}",
+ notify_update => $notify_update,
+ }