- if $key != false {
- if $key_content {
- exec { "Add key: ${key} from content":
- command => "/bin/echo '${key_content}' | /usr/bin/apt-key add -",
- unless => "/usr/bin/apt-key list | /bin/grep '${key}'",
- before => File["${name}.list"],
- }
+ $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,
+ }
+
+ if $pin {
+ if is_hash($pin) {
+ $_pin = merge($pin, { 'ensure' => $ensure, 'before' => $_before })
+ } elsif (is_numeric($pin) or is_string($pin)) {
+ $url_split = split($location, '[:\/]+')
+ $host = $url_split[1]
+ $_pin = {
+ 'ensure' => $ensure,
+ 'priority' => $pin,
+ 'before' => $_before,
+ 'origin' => $host,
+ }