13 $key_server = 'keyserver.ubuntu.com',
17 $architecture = undef,
18 $trusted_source = false,
20 validate_string($architecture)
21 validate_bool($trusted_source)
23 if $release == 'UNDEF' {
24 if $::lsbdistcodename == undef {
25 fail('lsbdistcodename fact not available: release parameter required')
27 $release_real = $::lsbdistcodename
30 $release_real = $release
33 file { "${name}.list":
35 path => "${::apt::sources_list_d}/${name}.list",
39 content => template('apt/_header.erb', 'apt/source.list.erb'),
40 notify => Exec['apt_update'],
45 # Get the host portion out of the url so we can pin to origin
46 $url_split = split($location, '/')
52 before => File["${name}.list"],
57 # We do not want to remove keys when the source is absent.
58 if $key and ($ensure == 'present') {
59 apt::key { "Add key: ${key} from Apt::Source ${title}":
62 key_server => $key_server,
63 key_content => $key_content,
64 key_source => $key_source,
65 before => File["${name}.list"],
69 # Need anchor to provide containment for dependencies.
70 anchor { "apt::source::${name}":
71 require => Class['apt::update'],