7 $release = $::apt::xfacts['lsbdistcodename'],
12 $architecture = undef,
13 $allow_unsigned = false,
15 validate_string($architecture, $comment, $location, $repos)
16 validate_bool($allow_unsigned)
17 validate_hash($include)
20 fail('lsbdistcodename fact not available: release parameter required')
23 if $ensure == 'present' and ! $location {
24 fail('cannot create a source entry without specifying a location')
27 $_before = Apt::Setting["list-${title}"]
28 $_include = merge($::apt::include_defaults, $include)
33 fail('key hash must contain at least an id entry')
35 $_key = merge($::apt::source_key_defaults, $key)
42 apt::setting { "list-${name}":
44 content => template('apt/_header.erb', 'apt/source.list.erb'),
49 $_pin = merge($pin, { 'ensure' => $ensure, 'before' => $_before })
50 } elsif (is_numeric($pin) or is_string($pin)) {
51 $url_split = split($location, '/')
60 fail('Received invalid value for pin parameter')
62 create_resources('apt::pin', { "${name}" => $_pin })
65 # We do not want to remove keys when the source is absent.
66 if $key and ($ensure == 'present') {
68 apt::key { "Add key: ${_key['id']} from Apt::Source ${title}":
71 server => $_key['server'],
72 content => $_key['content'],
73 source => $_key['source'],
74 options => $_key['options'],
78 apt::key { "Add key: ${_key} from Apt::Source ${title}":