service_kiosk 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Vagrantfile +25 -0
- data/bin/kiosk +55 -0
- data/bin/start_kiosk.sh +3 -0
- data/lib/Procfile.kiosk +1 -0
- data/lib/internal_service.rb +59 -0
- data/lib/json-simple-1.1.1.jar +0 -0
- data/lib/kiosk.rb +57 -0
- data/lib/kiosks/logger/output_logger.rb +16 -0
- data/lib/mall.rb +77 -0
- data/lib/mallcop.rb +9 -0
- data/lib/remote_service.rb +61 -0
- data/lib/tasks/local_mall.rake +93 -0
- data/provision/bootstrap.sh +21 -0
- data/provision/manifests/default.pp +49 -0
- data/provision/modules/apt/CHANGELOG +83 -0
- data/provision/modules/apt/LICENSE +19 -0
- data/provision/modules/apt/Modulefile +14 -0
- data/provision/modules/apt/README.md +119 -0
- data/provision/modules/apt/Rakefile +1 -0
- data/provision/modules/apt/manifests/backports.pp +48 -0
- data/provision/modules/apt/manifests/builddep.pp +16 -0
- data/provision/modules/apt/manifests/conf.pp +18 -0
- data/provision/modules/apt/manifests/debian/testing.pp +21 -0
- data/provision/modules/apt/manifests/debian/unstable.pp +21 -0
- data/provision/modules/apt/manifests/force.pp +24 -0
- data/provision/modules/apt/manifests/init.pp +114 -0
- data/provision/modules/apt/manifests/key.pp +80 -0
- data/provision/modules/apt/manifests/params.pp +23 -0
- data/provision/modules/apt/manifests/pin.pp +48 -0
- data/provision/modules/apt/manifests/ppa.pp +49 -0
- data/provision/modules/apt/manifests/release.pp +17 -0
- data/provision/modules/apt/manifests/source.pp +83 -0
- data/provision/modules/apt/manifests/update.pp +9 -0
- data/provision/modules/apt/spec/classes/apt_spec.rb +129 -0
- data/provision/modules/apt/spec/classes/backports_spec.rb +71 -0
- data/provision/modules/apt/spec/classes/debian_testing_spec.rb +14 -0
- data/provision/modules/apt/spec/classes/debian_unstable_spec.rb +14 -0
- data/provision/modules/apt/spec/classes/params_spec.rb +13 -0
- data/provision/modules/apt/spec/classes/release_spec.rb +22 -0
- data/provision/modules/apt/spec/defines/builddep_spec.rb +18 -0
- data/provision/modules/apt/spec/defines/conf_spec.rb +57 -0
- data/provision/modules/apt/spec/defines/force_spec.rb +41 -0
- data/provision/modules/apt/spec/defines/key_spec.rb +123 -0
- data/provision/modules/apt/spec/defines/pin_spec.rb +58 -0
- data/provision/modules/apt/spec/defines/ppa_spec.rb +92 -0
- data/provision/modules/apt/spec/defines/source_spec.rb +158 -0
- data/provision/modules/apt/spec/fixtures/manifests/site.pp +0 -0
- data/provision/modules/apt/spec/spec_helper.rb +1 -0
- data/provision/modules/apt/templates/pin.pref.erb +5 -0
- data/provision/modules/apt/templates/source.list.erb +5 -0
- data/provision/modules/apt/tests/builddep.pp +2 -0
- data/provision/modules/apt/tests/debian/testing.pp +2 -0
- data/provision/modules/apt/tests/debian/unstable.pp +2 -0
- data/provision/modules/apt/tests/force.pp +7 -0
- data/provision/modules/apt/tests/init.pp +1 -0
- data/provision/modules/apt/tests/key.pp +5 -0
- data/provision/modules/apt/tests/params.pp +1 -0
- data/provision/modules/apt/tests/pin.pp +5 -0
- data/provision/modules/apt/tests/ppa.pp +4 -0
- data/provision/modules/apt/tests/release.pp +4 -0
- data/provision/modules/apt/tests/source.pp +29 -0
- data/provision/modules/stdlib/CHANGELOG +177 -0
- data/provision/modules/stdlib/LICENSE +19 -0
- data/provision/modules/stdlib/Modulefile +11 -0
- data/provision/modules/stdlib/README.markdown +929 -0
- data/provision/modules/stdlib/README_DEVELOPER.markdown +35 -0
- data/provision/modules/stdlib/RELEASE_PROCESS.markdown +24 -0
- data/provision/modules/stdlib/Rakefile +2 -0
- data/provision/modules/stdlib/lib/facter/pe_version.rb +53 -0
- data/provision/modules/stdlib/lib/facter/puppet_vardir.rb +26 -0
- data/provision/modules/stdlib/lib/facter/root_home.rb +19 -0
- data/provision/modules/stdlib/lib/facter/util/puppet_settings.rb +21 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/abs.rb +36 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/bool2num.rb +49 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/capitalize.rb +34 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/chomp.rb +35 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/chop.rb +37 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/defined_with_params.rb +35 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/delete.rb +46 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/delete_at.rb +49 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/downcase.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/empty.rb +28 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/ensure_packages.rb +24 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb +35 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/flatten.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/fqdn_rotate.rb +46 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb +17 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/getvar.rb +26 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/grep.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/has_interface_with.rb +52 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/has_ip_address.rb +25 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/has_ip_network.rb +25 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/has_key.rb +28 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/hash.rb +41 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_array.rb +22 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_domain_name.rb +47 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_float.rb +27 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_hash.rb +22 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_integer.rb +27 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_ip_address.rb +32 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_mac_address.rb +27 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_numeric.rb +27 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/is_string.rb +26 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/join.rb +41 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/join_keys_to_values.rb +47 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/keys.rb +26 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb +20 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/lstrip.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/max.rb +13 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/member.rb +44 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/merge.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/min.rb +13 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/num2bool.rb +40 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/parsejson.rb +24 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/parseyaml.rb +24 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/pick.rb +29 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/prefix.rb +45 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/range.rb +80 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/reject.rb +31 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/reverse.rb +28 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/rstrip.rb +32 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/shuffle.rb +46 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/size.rb +48 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/sort.rb +27 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/squeeze.rb +36 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/str2bool.rb +41 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/str2saltedsha512.rb +32 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/strftime.rb +107 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/strip.rb +39 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/swapcase.rb +39 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/time.rb +49 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/to_bytes.rb +28 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/type.rb +50 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/unique.rb +51 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/upcase.rb +41 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/uriescape.rb +36 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/validate_absolute_path.rb +56 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/validate_array.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb +34 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/validate_hash.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/validate_re.rb +40 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb +52 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/validate_string.rb +33 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/values.rb +39 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/values_at.rb +98 -0
- data/provision/modules/stdlib/lib/puppet/parser/functions/zip.rb +65 -0
- data/provision/modules/stdlib/lib/puppet/provider/file_line/ruby.rb +59 -0
- data/provision/modules/stdlib/lib/puppet/type/anchor.rb +41 -0
- data/provision/modules/stdlib/lib/puppet/type/file_line.rb +70 -0
- data/provision/modules/stdlib/manifests/init.pp +20 -0
- data/provision/modules/stdlib/manifests/stages.pp +43 -0
- data/provision/modules/stdlib/spec/functions/defined_with_params_spec.rb +37 -0
- data/provision/modules/stdlib/spec/functions/ensure_packages_spec.rb +42 -0
- data/provision/modules/stdlib/spec/functions/ensure_resource_spec.rb +40 -0
- data/provision/modules/stdlib/spec/monkey_patches/alias_should_to_must.rb +8 -0
- data/provision/modules/stdlib/spec/monkey_patches/publicize_methods.rb +10 -0
- data/provision/modules/stdlib/spec/spec.opts +6 -0
- data/provision/modules/stdlib/spec/spec_helper.rb +28 -0
- data/provision/modules/stdlib/spec/unit/facter/pe_version_spec.rb +76 -0
- data/provision/modules/stdlib/spec/unit/facter/root_home_spec.rb +40 -0
- data/provision/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb +35 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/abs_spec.rb +25 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/bool2num_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/capitalize_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/chomp_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/chop_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/delete_at_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/delete_spec.rb +38 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/downcase_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/empty_spec.rb +23 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/flatten_spec.rb +23 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/fqdn_rotate_spec.rb +33 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/get_module_path_spec.rb +46 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/getvar_spec.rb +37 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/grep_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/has_interface_with_spec.rb +64 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/has_ip_address_spec.rb +39 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/has_ip_network_spec.rb +36 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/has_key_spec.rb +42 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/hash_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_array_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_domain_name_spec.rb +64 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_float_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_hash_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_integer_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_ip_address_spec.rb +39 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_mac_address_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_numeric_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/is_string_spec.rb +34 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/join_keys_to_values_spec.rb +40 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/join_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/keys_spec.rb +21 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/lstrip_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/max_spec.rb +23 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/member_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/merge_spec.rb +47 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/min_spec.rb +23 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/num2bool_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/parsejson_spec.rb +22 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/parseyaml_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/pick_spec.rb +34 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/prefix_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/range_spec.rb +34 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/reject_spec.rb +20 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/reverse_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/rstrip_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/shuffle_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/size_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/sort_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/squeeze_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/str2bool_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/str2saltedsha512_spec.rb +45 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/strftime_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/strip_spec.rb +18 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/swapcase_spec.rb +19 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/time_spec.rb +29 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/to_bytes_spec.rb +58 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/type_spec.rb +43 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/unique_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/upcase_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/uriescape_spec.rb +24 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb +83 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/validate_array_spec.rb +38 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/validate_bool_spec.rb +51 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/validate_hash_spec.rb +43 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/validate_re_spec.rb +76 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/validate_slength_spec.rb +48 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/validate_string_spec.rb +60 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/values_at_spec.rb +38 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/values_spec.rb +31 -0
- data/provision/modules/stdlib/spec/unit/puppet/parser/functions/zip_spec.rb +15 -0
- data/provision/modules/stdlib/spec/unit/puppet/provider/file_line/ruby_spec.rb +127 -0
- data/provision/modules/stdlib/spec/unit/puppet/type/anchor_spec.rb +11 -0
- data/provision/modules/stdlib/spec/unit/puppet/type/file_line_spec.rb +69 -0
- data/provision/modules/stdlib/spec/watchr.rb +86 -0
- data/provision/modules/stdlib/tests/file_line.pp +9 -0
- data/provision/modules/stdlib/tests/has_interface_with.pp +10 -0
- data/provision/modules/stdlib/tests/has_ip_address.pp +3 -0
- data/provision/modules/stdlib/tests/has_ip_network.pp +4 -0
- data/provision/modules/stdlib/tests/init.pp +1 -0
- metadata +291 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Apt module for Puppet
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
Provides helpful definitions for dealing with Apt.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
### apt
|
|
9
|
+
The apt class provides a number of common resources and options which
|
|
10
|
+
are shared by the various defined types in this module. This class
|
|
11
|
+
should always be included in your manifests if you are using the `apt`
|
|
12
|
+
module.
|
|
13
|
+
|
|
14
|
+
class { 'apt':
|
|
15
|
+
always_apt_update => false,
|
|
16
|
+
disable_keys => undef,
|
|
17
|
+
proxy_host => false,
|
|
18
|
+
proxy_port => '8080',
|
|
19
|
+
purge_sources_list => false,
|
|
20
|
+
purge_sources_list_d => false,
|
|
21
|
+
purge_preferences_d => false
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
### apt::builddep
|
|
25
|
+
Install the build depends of a specified package.
|
|
26
|
+
|
|
27
|
+
apt::builddep { "glusterfs-server": }
|
|
28
|
+
|
|
29
|
+
### apt::force
|
|
30
|
+
Force a package to be installed from a specific release. Useful when
|
|
31
|
+
using repositories like Debian unstable in Ubuntu.
|
|
32
|
+
|
|
33
|
+
apt::force { "glusterfs-server":
|
|
34
|
+
release => "unstable",
|
|
35
|
+
version => '3.0.3',
|
|
36
|
+
require => Apt::Source["debian_unstable"],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
### apt::pin
|
|
40
|
+
Add an apt pin for a certain release.
|
|
41
|
+
|
|
42
|
+
apt::pin { "karmic": priority => 700 }
|
|
43
|
+
apt::pin { "karmic-updates": priority => 700 }
|
|
44
|
+
apt::pin { "karmic-security": priority => 700 }
|
|
45
|
+
|
|
46
|
+
### apt::ppa
|
|
47
|
+
Add a ppa repository using `add-apt-repository`. Somewhat experimental.
|
|
48
|
+
|
|
49
|
+
apt::ppa { "ppa:drizzle-developers/ppa": }
|
|
50
|
+
|
|
51
|
+
### apt::release
|
|
52
|
+
Set the default apt release. Useful when using repositories like
|
|
53
|
+
Debian unstable in Ubuntu.
|
|
54
|
+
|
|
55
|
+
apt::release { "karmic": }
|
|
56
|
+
|
|
57
|
+
### apt::source
|
|
58
|
+
Add an apt source to `/etc/apt/sources.list.d/`.
|
|
59
|
+
|
|
60
|
+
apt::source { "debian_unstable":
|
|
61
|
+
location => "http://debian.mirror.iweb.ca/debian/",
|
|
62
|
+
release => "unstable",
|
|
63
|
+
repos => "main contrib non-free",
|
|
64
|
+
required_packages => "debian-keyring debian-archive-keyring",
|
|
65
|
+
key => "55BE302B",
|
|
66
|
+
key_server => "subkeys.pgp.net",
|
|
67
|
+
pin => "-10",
|
|
68
|
+
include_src => true
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
This source will configure your system for the Puppet Labs APT
|
|
72
|
+
repository.
|
|
73
|
+
|
|
74
|
+
apt::source { 'puppetlabs':
|
|
75
|
+
location => 'http://apt.puppetlabs.com',
|
|
76
|
+
repos => 'main',
|
|
77
|
+
key => '4BD6EC30',
|
|
78
|
+
key_server => 'pgp.mit.edu',
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
### apt::key
|
|
82
|
+
Add a key to the list of keys used by apt to authenticate packages.
|
|
83
|
+
|
|
84
|
+
apt::key { "puppetlabs":
|
|
85
|
+
key => "4BD6EC30",
|
|
86
|
+
key_server => "pgp.mit.edu",
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
apt::key { "jenkins":
|
|
90
|
+
key => "D50582E6",
|
|
91
|
+
key_source => "http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key",
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
Note that use of the "key_source" parameter requires wget to be
|
|
95
|
+
installed and working.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## Contributors
|
|
99
|
+
A lot of great people have contributed to this module. A somewhat
|
|
100
|
+
current list follows.
|
|
101
|
+
|
|
102
|
+
Ben Godfrey <ben.godfrey@wonga.com>
|
|
103
|
+
Branan Purvine-Riley <branan@puppetlabs.com>
|
|
104
|
+
Christian G. Warden <cwarden@xerus.org>
|
|
105
|
+
Dan Bode <bodepd@gmail.com> <dan@puppetlabs.com>
|
|
106
|
+
Garrett Honeycutt <github@garretthoneycutt.com>
|
|
107
|
+
Jeff Wallace <jeff@evolvingweb.ca> <jeff@tjwallace.ca>
|
|
108
|
+
Ken Barber <ken@bob.sh>
|
|
109
|
+
Matthaus Litteken <matthaus@puppetlabs.com> <mlitteken@gmail.com>
|
|
110
|
+
Matthias Pigulla <mp@webfactory.de>
|
|
111
|
+
Monty Taylor <mordred@inaugust.com>
|
|
112
|
+
Peter Drake <pdrake@allplayers.com>
|
|
113
|
+
Reid Vandewiele <marut@cat.pdx.edu>
|
|
114
|
+
Robert Navarro <rnavarro@phiivo.com>
|
|
115
|
+
Ryan Coleman <ryan@puppetlabs.com>
|
|
116
|
+
Scott McLeod <scott.mcleod@theice.com>
|
|
117
|
+
Spencer Krum <spencer@puppetlabs.com>
|
|
118
|
+
William Van Hevelingen <blkperl@cat.pdx.edu> <wvan13@gmail.com>
|
|
119
|
+
Zach Leslie <zach@puppetlabs.com>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'puppetlabs_spec_helper/rake_tasks'
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# This adds the necessary components to get backports for ubuntu and debian
|
|
2
|
+
#
|
|
3
|
+
# == Parameters
|
|
4
|
+
#
|
|
5
|
+
# [*release*]
|
|
6
|
+
# The ubuntu/debian release name. Defaults to $lsbdistcodename. Setting this
|
|
7
|
+
# manually can cause undefined behavior. (Read: universe exploding)
|
|
8
|
+
#
|
|
9
|
+
# == Examples
|
|
10
|
+
#
|
|
11
|
+
# include apt::backports
|
|
12
|
+
#
|
|
13
|
+
# class { 'apt::backports':
|
|
14
|
+
# release => 'natty',
|
|
15
|
+
# }
|
|
16
|
+
#
|
|
17
|
+
# == Authors
|
|
18
|
+
#
|
|
19
|
+
# Ben Hughes, I think. At least blame him if this goes wrong.
|
|
20
|
+
# I just added puppet doc.
|
|
21
|
+
#
|
|
22
|
+
# == Copyright
|
|
23
|
+
#
|
|
24
|
+
# Copyright 2011 Puppet Labs Inc, unless otherwise noted.
|
|
25
|
+
class apt::backports(
|
|
26
|
+
$release = $::lsbdistcodename,
|
|
27
|
+
$location = $apt::params::backports_location
|
|
28
|
+
) inherits apt::params {
|
|
29
|
+
|
|
30
|
+
$release_real = downcase($release)
|
|
31
|
+
$key = $::lsbdistid ? {
|
|
32
|
+
'debian' => '55BE302B',
|
|
33
|
+
'ubuntu' => '437D05B5',
|
|
34
|
+
}
|
|
35
|
+
$repos = $::lsbdistid ? {
|
|
36
|
+
'debian' => 'main contrib non-free',
|
|
37
|
+
'ubuntu' => 'main universe multiverse restricted',
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
apt::source { 'backports':
|
|
41
|
+
location => $location,
|
|
42
|
+
release => "${release_real}-backports",
|
|
43
|
+
repos => $repos,
|
|
44
|
+
key => $key,
|
|
45
|
+
key_server => 'pgp.mit.edu',
|
|
46
|
+
pin => '200',
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# builddep.pp
|
|
2
|
+
|
|
3
|
+
define apt::builddep() {
|
|
4
|
+
include apt::update
|
|
5
|
+
|
|
6
|
+
exec { "apt-builddep-${name}":
|
|
7
|
+
command => "/usr/bin/apt-get -y --force-yes build-dep ${name}",
|
|
8
|
+
logoutput => 'on_failure',
|
|
9
|
+
notify => Exec['apt_update'],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
# Need anchor to provide containment for dependencies.
|
|
13
|
+
anchor { "apt::builddep::${name}":
|
|
14
|
+
require => Class['apt::update'],
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
define apt::conf (
|
|
2
|
+
$content,
|
|
3
|
+
$ensure = present,
|
|
4
|
+
$priority = '50'
|
|
5
|
+
) {
|
|
6
|
+
|
|
7
|
+
include apt::params
|
|
8
|
+
|
|
9
|
+
$apt_conf_d = $apt::params::apt_conf_d
|
|
10
|
+
|
|
11
|
+
file { "${apt_conf_d}/${priority}${name}":
|
|
12
|
+
ensure => $ensure,
|
|
13
|
+
content => $content,
|
|
14
|
+
owner => root,
|
|
15
|
+
group => root,
|
|
16
|
+
mode => '0644',
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# testing.pp
|
|
2
|
+
|
|
3
|
+
class apt::debian::testing {
|
|
4
|
+
include apt
|
|
5
|
+
|
|
6
|
+
# deb http://debian.mirror.iweb.ca/debian/ testing main contrib non-free
|
|
7
|
+
# deb-src http://debian.mirror.iweb.ca/debian/ testing main contrib non-free
|
|
8
|
+
# Key: 55BE302B Server: subkeys.pgp.net
|
|
9
|
+
# debian-keyring
|
|
10
|
+
# debian-archive-keyring
|
|
11
|
+
|
|
12
|
+
apt::source { 'debian_testing':
|
|
13
|
+
location => 'http://debian.mirror.iweb.ca/debian/',
|
|
14
|
+
release => 'testing',
|
|
15
|
+
repos => 'main contrib non-free',
|
|
16
|
+
required_packages => 'debian-keyring debian-archive-keyring',
|
|
17
|
+
key => '55BE302B',
|
|
18
|
+
key_server => 'subkeys.pgp.net',
|
|
19
|
+
pin => '-10',
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# unstable.pp
|
|
2
|
+
|
|
3
|
+
class apt::debian::unstable {
|
|
4
|
+
include apt
|
|
5
|
+
|
|
6
|
+
# deb http://debian.mirror.iweb.ca/debian/ unstable main contrib non-free
|
|
7
|
+
# deb-src http://debian.mirror.iweb.ca/debian/ unstable main contrib non-free
|
|
8
|
+
# Key: 55BE302B Server: subkeys.pgp.net
|
|
9
|
+
# debian-keyring
|
|
10
|
+
# debian-archive-keyring
|
|
11
|
+
|
|
12
|
+
apt::source { 'debian_unstable':
|
|
13
|
+
location => 'http://debian.mirror.iweb.ca/debian/',
|
|
14
|
+
release => 'unstable',
|
|
15
|
+
repos => 'main contrib non-free',
|
|
16
|
+
required_packages => 'debian-keyring debian-archive-keyring',
|
|
17
|
+
key => '55BE302B',
|
|
18
|
+
key_server => 'subkeys.pgp.net',
|
|
19
|
+
pin => '-10',
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# force.pp
|
|
2
|
+
# force a package from a specific release
|
|
3
|
+
|
|
4
|
+
define apt::force(
|
|
5
|
+
$release = 'testing',
|
|
6
|
+
$version = false,
|
|
7
|
+
$timeout = 300
|
|
8
|
+
) {
|
|
9
|
+
|
|
10
|
+
$version_string = $version ? {
|
|
11
|
+
false => undef,
|
|
12
|
+
default => "=${version}",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$install_check = $version ? {
|
|
16
|
+
false => "/usr/bin/dpkg -s ${name} | grep -q 'Status: install'",
|
|
17
|
+
default => "/usr/bin/dpkg -s ${name} | grep -q 'Version: ${version}'",
|
|
18
|
+
}
|
|
19
|
+
exec { "/usr/bin/aptitude -y -t ${release} install ${name}${version_string}":
|
|
20
|
+
unless => $install_check,
|
|
21
|
+
logoutput => 'on_failure',
|
|
22
|
+
timeout => $timeout,
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Class: apt
|
|
2
|
+
#
|
|
3
|
+
# This module manages the initial configuration of apt.
|
|
4
|
+
#
|
|
5
|
+
# Parameters:
|
|
6
|
+
# The parameters listed here are not required in general and were
|
|
7
|
+
# added for use cases related to development environments.
|
|
8
|
+
# disable_keys - disables the requirement for all packages to be signed
|
|
9
|
+
# always_apt_update - rather apt should be updated on every run (intended
|
|
10
|
+
# for development environments where package updates are frequent)
|
|
11
|
+
# purge_sources_list - Accepts true or false. Defaults to false If set to
|
|
12
|
+
# true, Puppet will purge all unmanaged entries from sources.list
|
|
13
|
+
# purge_sources_list_d - Accepts true or false. Defaults to false. If set
|
|
14
|
+
# to true, Puppet will purge all unmanaged entries from sources.list.d
|
|
15
|
+
#
|
|
16
|
+
# Actions:
|
|
17
|
+
#
|
|
18
|
+
# Requires:
|
|
19
|
+
# puppetlabs/stdlib
|
|
20
|
+
# Sample Usage:
|
|
21
|
+
# class { 'apt': }
|
|
22
|
+
|
|
23
|
+
class apt(
|
|
24
|
+
$always_apt_update = false,
|
|
25
|
+
$disable_keys = undef,
|
|
26
|
+
$proxy_host = false,
|
|
27
|
+
$proxy_port = '8080',
|
|
28
|
+
$purge_sources_list = false,
|
|
29
|
+
$purge_sources_list_d = false,
|
|
30
|
+
$purge_preferences_d = false
|
|
31
|
+
) {
|
|
32
|
+
|
|
33
|
+
include apt::params
|
|
34
|
+
include apt::update
|
|
35
|
+
|
|
36
|
+
validate_bool($purge_sources_list, $purge_sources_list_d, $purge_preferences_d)
|
|
37
|
+
|
|
38
|
+
$sources_list_content = $purge_sources_list ? {
|
|
39
|
+
false => undef,
|
|
40
|
+
true => "# Repos managed by puppet.\n",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if $always_apt_update == true {
|
|
44
|
+
Exec <| title=='apt_update' |> {
|
|
45
|
+
refreshonly => false,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
$root = $apt::params::root
|
|
50
|
+
$apt_conf_d = $apt::params::apt_conf_d
|
|
51
|
+
$sources_list_d = $apt::params::sources_list_d
|
|
52
|
+
$preferences_d = $apt::params::preferences_d
|
|
53
|
+
$provider = $apt::params::provider
|
|
54
|
+
|
|
55
|
+
file { 'sources.list':
|
|
56
|
+
ensure => present,
|
|
57
|
+
path => "${root}/sources.list",
|
|
58
|
+
owner => root,
|
|
59
|
+
group => root,
|
|
60
|
+
mode => '0644',
|
|
61
|
+
content => $sources_list_content,
|
|
62
|
+
notify => Exec['apt_update'],
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
file { 'sources.list.d':
|
|
66
|
+
ensure => directory,
|
|
67
|
+
path => $sources_list_d,
|
|
68
|
+
owner => root,
|
|
69
|
+
group => root,
|
|
70
|
+
purge => $purge_sources_list_d,
|
|
71
|
+
recurse => $purge_sources_list_d,
|
|
72
|
+
notify => Exec['apt_update'],
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
file { 'preferences.d':
|
|
76
|
+
ensure => directory,
|
|
77
|
+
path => $preferences_d,
|
|
78
|
+
owner => root,
|
|
79
|
+
group => root,
|
|
80
|
+
purge => $purge_preferences_d,
|
|
81
|
+
recurse => $purge_preferences_d,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
case $disable_keys {
|
|
85
|
+
true: {
|
|
86
|
+
file { '99unauth':
|
|
87
|
+
ensure => present,
|
|
88
|
+
content => "APT::Get::AllowUnauthenticated 1;\n",
|
|
89
|
+
path => "${apt_conf_d}/99unauth",
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
false: {
|
|
93
|
+
file { '99unauth':
|
|
94
|
+
ensure => absent,
|
|
95
|
+
path => "${apt_conf_d}/99unauth",
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
undef: { } # do nothing
|
|
99
|
+
default: { fail('Valid values for disable_keys are true or false') }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if ($proxy_host) {
|
|
103
|
+
file { 'configure-apt-proxy':
|
|
104
|
+
path => "${apt_conf_d}/proxy",
|
|
105
|
+
content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";",
|
|
106
|
+
notify => Exec['apt_update'],
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# Need anchor to provide containment for dependencies.
|
|
111
|
+
anchor { 'apt::update':
|
|
112
|
+
require => Class['apt::update'],
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
define apt::key (
|
|
2
|
+
$key = $title,
|
|
3
|
+
$ensure = present,
|
|
4
|
+
$key_content = false,
|
|
5
|
+
$key_source = false,
|
|
6
|
+
$key_server = 'keyserver.ubuntu.com'
|
|
7
|
+
) {
|
|
8
|
+
|
|
9
|
+
include apt::params
|
|
10
|
+
|
|
11
|
+
$upkey = upcase($key)
|
|
12
|
+
|
|
13
|
+
if $key_content {
|
|
14
|
+
$method = 'content'
|
|
15
|
+
} elsif $key_source {
|
|
16
|
+
$method = 'source'
|
|
17
|
+
} elsif $key_server {
|
|
18
|
+
$method = 'server'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
# This is a hash of the parts of the key definition that we care about.
|
|
22
|
+
# It is used as a unique identifier for this instance of apt::key. It gets
|
|
23
|
+
# hashed to ensure that the resource name doesn't end up being pages and
|
|
24
|
+
# pages (e.g. in the situation where key_content is specified).
|
|
25
|
+
$digest = sha1("${upkey}/${key_content}/${key_source}/${key_server}/")
|
|
26
|
+
|
|
27
|
+
# Allow multiple ensure => present for the same key to account for many
|
|
28
|
+
# apt::source resources that all reference the same key.
|
|
29
|
+
case $ensure {
|
|
30
|
+
present: {
|
|
31
|
+
|
|
32
|
+
anchor { "apt::key/${title}": }
|
|
33
|
+
|
|
34
|
+
if defined(Exec["apt::key ${upkey} absent"]) {
|
|
35
|
+
fail("Cannot ensure Apt::Key[${upkey}] present; ${upkey} already ensured absent")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if !defined(Anchor["apt::key ${upkey} present"]) {
|
|
39
|
+
anchor { "apt::key ${upkey} present": }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if !defined(Exec[$digest]) {
|
|
43
|
+
$digest_command = $method ? {
|
|
44
|
+
'content' => "echo '${key_content}' | /usr/bin/apt-key add -",
|
|
45
|
+
'source' => "wget -q '${key_source}' -O- | apt-key add -",
|
|
46
|
+
'server' => "apt-key adv --keyserver '${key_server}' --recv-keys '${upkey}'",
|
|
47
|
+
}
|
|
48
|
+
exec { $digest:
|
|
49
|
+
command => $digest_command,
|
|
50
|
+
path => '/bin:/usr/bin',
|
|
51
|
+
unless => "/usr/bin/apt-key list | /bin/grep '${upkey}'",
|
|
52
|
+
logoutput => 'on_failure',
|
|
53
|
+
before => Anchor["apt::key ${upkey} present"],
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Anchor["apt::key ${upkey} present"] -> Anchor["apt::key/${title}"]
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
absent: {
|
|
61
|
+
|
|
62
|
+
if defined(Anchor["apt::key ${upkey} present"]) {
|
|
63
|
+
fail("Cannot ensure Apt::Key[${upkey}] absent; ${upkey} already ensured present")
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
exec { "apt::key ${upkey} absent":
|
|
67
|
+
command => "apt-key del '${upkey}'",
|
|
68
|
+
path => '/bin:/usr/bin',
|
|
69
|
+
onlyif => "apt-key list | grep '${upkey}'",
|
|
70
|
+
user => 'root',
|
|
71
|
+
group => 'root',
|
|
72
|
+
logoutput => 'on_failure',
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
default: {
|
|
77
|
+
fail "Invalid 'ensure' value '${ensure}' for aptkey"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
class apt::params {
|
|
2
|
+
$root = '/etc/apt'
|
|
3
|
+
$provider = '/usr/bin/apt-get'
|
|
4
|
+
$sources_list_d = "${root}/sources.list.d"
|
|
5
|
+
$apt_conf_d = "${root}/apt.conf.d"
|
|
6
|
+
$preferences_d = "${root}/preferences.d"
|
|
7
|
+
|
|
8
|
+
case $::lsbdistid {
|
|
9
|
+
'debian': {
|
|
10
|
+
$backports_location = 'http://backports.debian.org/debian-backports'
|
|
11
|
+
}
|
|
12
|
+
'ubuntu': {
|
|
13
|
+
case $::lsbdistcodename {
|
|
14
|
+
'hardy','lucid','maverick','natty','oneiric','precise': {
|
|
15
|
+
$backports_location = 'http://us.archive.ubuntu.com/ubuntu'
|
|
16
|
+
}
|
|
17
|
+
default: {
|
|
18
|
+
$backports_location = 'http://old-releases.ubuntu.com/ubuntu'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# pin.pp
|
|
2
|
+
# pin a release in apt, useful for unstable repositories
|
|
3
|
+
|
|
4
|
+
define apt::pin(
|
|
5
|
+
$ensure = present,
|
|
6
|
+
$explanation = "${::caller_module_name}: ${name}",
|
|
7
|
+
$order = '',
|
|
8
|
+
$packages = '*',
|
|
9
|
+
$priority = 0,
|
|
10
|
+
$release = '',
|
|
11
|
+
$origin = '',
|
|
12
|
+
$originator = '',
|
|
13
|
+
$version = ''
|
|
14
|
+
) {
|
|
15
|
+
|
|
16
|
+
include apt::params
|
|
17
|
+
|
|
18
|
+
$preferences_d = $apt::params::preferences_d
|
|
19
|
+
|
|
20
|
+
if $order != '' and !is_integer($order) {
|
|
21
|
+
fail('Only integers are allowed in the apt::pin order param')
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if $release != '' {
|
|
25
|
+
$pin = "release a=${release}"
|
|
26
|
+
} elsif $origin != '' {
|
|
27
|
+
$pin = "origin \"${origin}\""
|
|
28
|
+
} elsif $originator != '' {
|
|
29
|
+
$pin = "release o=${originator}"
|
|
30
|
+
} elsif $version != '' {
|
|
31
|
+
$pin = "version ${version}"
|
|
32
|
+
} else {
|
|
33
|
+
$pin = "release a=${name}"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$path = $order ? {
|
|
37
|
+
'' => "${preferences_d}/${name}.pref",
|
|
38
|
+
default => "${preferences_d}/${order}-${name}.pref",
|
|
39
|
+
}
|
|
40
|
+
file { "${name}.pref":
|
|
41
|
+
ensure => $ensure,
|
|
42
|
+
path => $path,
|
|
43
|
+
owner => root,
|
|
44
|
+
group => root,
|
|
45
|
+
mode => '0644',
|
|
46
|
+
content => template('apt/pin.pref.erb'),
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ppa.pp
|
|
2
|
+
|
|
3
|
+
define apt::ppa(
|
|
4
|
+
$release = $::lsbdistcodename
|
|
5
|
+
) {
|
|
6
|
+
include apt::params
|
|
7
|
+
include apt::update
|
|
8
|
+
|
|
9
|
+
$sources_list_d = $apt::params::sources_list_d
|
|
10
|
+
|
|
11
|
+
if ! $release {
|
|
12
|
+
fail('lsbdistcodename fact not available: release parameter required')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$filename_without_slashes = regsubst($name, '/', '-', G)
|
|
16
|
+
$filename_without_dots = regsubst($filename_without_slashes, '\.', '_', G)
|
|
17
|
+
$filename_without_ppa = regsubst($filename_without_dots, '^ppa:', '', G)
|
|
18
|
+
$sources_list_d_filename = "${filename_without_ppa}-${release}.list"
|
|
19
|
+
|
|
20
|
+
$package = $::lsbdistrelease ? {
|
|
21
|
+
/^[1-9]\..*|1[01]\..*|12.04$/ => 'python-software-properties',
|
|
22
|
+
default => 'software-properties-common',
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if ! defined(Package[$package]) {
|
|
26
|
+
package { $package: }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
exec { "add-apt-repository-${name}":
|
|
30
|
+
command => "/usr/bin/add-apt-repository ${name}",
|
|
31
|
+
creates => "${sources_list_d}/${sources_list_d_filename}",
|
|
32
|
+
logoutput => 'on_failure',
|
|
33
|
+
require => [
|
|
34
|
+
File[$sources_list_d],
|
|
35
|
+
Package["${package}"],
|
|
36
|
+
],
|
|
37
|
+
notify => Exec['apt_update'],
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
file { "${sources_list_d}/${sources_list_d_filename}":
|
|
41
|
+
ensure => file,
|
|
42
|
+
require => Exec["add-apt-repository-${name}"],
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# Need anchor to provide containment for dependencies.
|
|
46
|
+
anchor { "apt::ppa::${name}":
|
|
47
|
+
require => Class['apt::update'],
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# release.pp
|
|
2
|
+
|
|
3
|
+
class apt::release (
|
|
4
|
+
$release_id
|
|
5
|
+
) {
|
|
6
|
+
|
|
7
|
+
include apt::params
|
|
8
|
+
|
|
9
|
+
$root = $apt::params::root
|
|
10
|
+
|
|
11
|
+
file { "${root}/apt.conf.d/01release":
|
|
12
|
+
owner => root,
|
|
13
|
+
group => root,
|
|
14
|
+
mode => '0644',
|
|
15
|
+
content => "APT::Default-Release \"${release_id}\";"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# source.pp
|
|
2
|
+
# add an apt source
|
|
3
|
+
|
|
4
|
+
define apt::source(
|
|
5
|
+
$ensure = present,
|
|
6
|
+
$location = '',
|
|
7
|
+
$release = 'UNDEF',
|
|
8
|
+
$repos = 'main',
|
|
9
|
+
$include_src = true,
|
|
10
|
+
$required_packages = false,
|
|
11
|
+
$key = false,
|
|
12
|
+
$key_server = 'keyserver.ubuntu.com',
|
|
13
|
+
$key_content = false,
|
|
14
|
+
$key_source = false,
|
|
15
|
+
$pin = false
|
|
16
|
+
) {
|
|
17
|
+
|
|
18
|
+
include apt::params
|
|
19
|
+
include apt::update
|
|
20
|
+
|
|
21
|
+
$sources_list_d = $apt::params::sources_list_d
|
|
22
|
+
$provider = $apt::params::provider
|
|
23
|
+
|
|
24
|
+
if $release == 'UNDEF' {
|
|
25
|
+
if $::lsbdistcodename == undef {
|
|
26
|
+
fail('lsbdistcodename fact not available: release parameter required')
|
|
27
|
+
} else {
|
|
28
|
+
$release_real = $::lsbdistcodename
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
$release_real = $release
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
file { "${name}.list":
|
|
35
|
+
ensure => $ensure,
|
|
36
|
+
path => "${sources_list_d}/${name}.list",
|
|
37
|
+
owner => root,
|
|
38
|
+
group => root,
|
|
39
|
+
mode => '0644',
|
|
40
|
+
content => template("${module_name}/source.list.erb"),
|
|
41
|
+
notify => Exec['apt_update'],
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
if ($pin != false) {
|
|
46
|
+
# Get the host portion out of the url so we can pin to origin
|
|
47
|
+
$url_split = split($location, '/')
|
|
48
|
+
$host = $url_split[2]
|
|
49
|
+
|
|
50
|
+
apt::pin { $name:
|
|
51
|
+
ensure => $ensure,
|
|
52
|
+
priority => $pin,
|
|
53
|
+
before => File["${name}.list"],
|
|
54
|
+
origin => $host,
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if ($required_packages != false) and ($ensure == 'present') {
|
|
59
|
+
exec { "Required packages: '${required_packages}' for ${name}":
|
|
60
|
+
command => "${provider} -y install ${required_packages}",
|
|
61
|
+
logoutput => 'on_failure',
|
|
62
|
+
refreshonly => true,
|
|
63
|
+
subscribe => File["${name}.list"],
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
# We do not want to remove keys when the source is absent.
|
|
68
|
+
if ($key != false) and ($ensure == 'present') {
|
|
69
|
+
apt::key { "Add key: ${key} from Apt::Source ${title}":
|
|
70
|
+
ensure => present,
|
|
71
|
+
key => $key,
|
|
72
|
+
key_server => $key_server,
|
|
73
|
+
key_content => $key_content,
|
|
74
|
+
key_source => $key_source,
|
|
75
|
+
before => File["${name}.list"],
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# Need anchor to provide containment for dependencies.
|
|
80
|
+
anchor { "apt::source::${name}":
|
|
81
|
+
require => Class['apt::update'],
|
|
82
|
+
}
|
|
83
|
+
}
|