3 if $::osfamily != 'Debian' {
4 fail('This module only works on Debian or derivatives like Ubuntu')
7 # prior to puppet 3.5.0, defined couldn't test if a variable was defined
8 # strict variables wasn't added until 3.5.0, so this should be fine.
9 if ! $::settings::strict_variables {
11 'lsbdistcodename' => $::lsbdistcodename,
12 'lsbdistrelease' => $::lsbdistrelease,
13 'lsbmajdistrelease' => $::lsbmajdistrelease,
14 'lsbdistdescription' => $::lsbdistdescription,
15 'lsbminordistrelease' => $::lsbminordistrelease,
16 'lsbdistid' => $::lsbdistid,
19 # Strict variables facts lookup compatibility
21 'lsbdistcodename' => defined('$lsbdistcodename') ? {
22 true => $::lsbdistcodename,
25 'lsbdistrelease' => defined('$lsbdistrelease') ? {
26 true => $::lsbdistrelease,
29 'lsbmajdistrelease' => defined('$lsbmajdistrelease') ? {
30 true => $::lsbmajdistrelease,
33 'lsbdistdescription' => defined('$lsbdistdescription') ? {
34 true => $::lsbdistdescription,
37 'lsbminordistrelease' => defined('$lsbminordistrelease') ? {
38 true => $::lsbminordistrelease,
41 'lsbdistid' => defined('$lsbdistid') ? {
49 $provider = '/usr/bin/apt-get'
50 $sources_list = "${root}/sources.list"
51 $sources_list_d = "${root}/sources.list.d"
52 $conf_d = "${root}/apt.conf.d"
53 $preferences = "${root}/preferences"
54 $preferences_d = "${root}/preferences.d"
55 $keyserver = 'keyserver.ubuntu.com'
63 'path' => $preferences_d,
67 'path' => $sources_list_d,
73 'frequency' => 'reluctantly',
86 'sources.list' => false,
87 'sources.list.d' => false,
88 'preferences' => false,
89 'preferences.d' => false,
92 $source_key_defaults = {
93 'server' => $keyserver,
104 case $xfacts['lsbdistid'] {
106 case $xfacts['lsbdistcodename'] {
109 'location' => 'http://httpredir.debian.org/debian-backports',
110 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
111 'repos' => 'main contrib non-free',
116 'location' => 'http://httpredir.debian.org/debian',
117 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
118 'repos' => 'main contrib non-free',
129 'location' => 'http://archive.ubuntu.com/ubuntu',
130 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5',
131 'repos' => 'main universe multiverse restricted',
134 case $xfacts['lsbdistcodename'] {
137 $ppa_package = 'python-software-properties'
141 $ppa_package = 'python-software-properties'
143 'trusty', 'utopic', 'vivid', 'wily': {
145 $ppa_package = 'software-properties-common'
149 $ppa_package = 'python-software-properties'
154 fail('Unable to determine lsbdistid, please install lsb-release first')