387
|
1 # @summary Configure the proper EPEL repositories and import GPG keys
|
272
|
2 #
|
387
|
3 # @param epel_managed
|
|
4 # Determines if the main EPEL repository is managed.
|
|
5 # @param epel_source_managed
|
|
6 # Determines if the `epel-source` repository is managed.
|
|
7 # @param epel_debuginfo_managed
|
|
8 # Determines if the `epel-debuginfo` repository is managed.
|
|
9 # @param epel_testing_managed
|
|
10 # Determines if the `epel-testing` repository is managed.
|
|
11 # @param epel_testing_source_managed
|
|
12 # Determines if the `epel-testing-source` repository is managed.
|
|
13 # @param epel_testing_debuginfo_managed
|
|
14 # Determines if the `epel-testing-debuginfo` repository is managed.
|
|
15 # @param epel_gpg_managed
|
|
16 # Detemines if the module manages the rpm-gpg key for EPEL.
|
272
|
17 #
|
387
|
18 # @example Basic Usage
|
|
19 # include epel
|
272
|
20 #
|
387
|
21 # @see https://fedoraproject.org/wiki/EPEL
|
272
|
22 class epel (
|
387
|
23 $epel_mirrorlist = $epel::params::epel_mirrorlist,
|
|
24 $epel_baseurl = $epel::params::epel_baseurl,
|
|
25 $epel_failovermethod = $epel::params::epel_failovermethod,
|
|
26 $epel_proxy = $epel::params::epel_proxy,
|
|
27 $epel_enabled = $epel::params::epel_enabled,
|
|
28 $epel_gpgcheck = $epel::params::epel_gpgcheck,
|
|
29 $epel_repo_gpgcheck = $epel::params::epel_repo_gpgcheck,
|
|
30 $epel_metalink = $epel::params::epel_metalink,
|
|
31 Boolean $epel_managed = true,
|
|
32 $epel_exclude = undef,
|
|
33 $epel_includepkgs = undef,
|
|
34 $epel_sslclientkey = undef,
|
|
35 $epel_sslclientcert = undef,
|
|
36 Optional[String[1]] $epel_username = undef,
|
|
37 Optional[String[1]] $epel_password = undef,
|
|
38 $epel_testing_mirrorlist = $epel::params::epel_testing_mirrorlist,
|
|
39 $epel_testing_baseurl = $epel::params::epel_testing_baseurl,
|
|
40 $epel_testing_failovermethod = $epel::params::epel_testing_failovermethod,
|
|
41 $epel_testing_proxy = $epel::params::epel_testing_proxy,
|
|
42 $epel_testing_enabled = $epel::params::epel_testing_enabled,
|
|
43 $epel_testing_gpgcheck = $epel::params::epel_testing_gpgcheck,
|
|
44 $epel_testing_repo_gpgcheck = $epel::params::epel_testing_repo_gpgcheck,
|
|
45 $epel_testing_metalink = $epel::params::epel_testing_metalink,
|
|
46 Boolean $epel_testing_managed = true,
|
|
47 $epel_testing_exclude = undef,
|
|
48 $epel_testing_includepkgs = undef,
|
|
49 $epel_testing_sslclientkey = undef,
|
|
50 $epel_testing_sslclientcert = undef,
|
|
51 Optional[String[1]] $epel_testing_username = undef,
|
|
52 Optional[String[1]] $epel_testing_password = undef,
|
|
53 $epel_source_mirrorlist = $epel::params::epel_source_mirrorlist,
|
|
54 $epel_source_baseurl = $epel::params::epel_source_baseurl,
|
|
55 $epel_source_failovermethod = $epel::params::epel_source_failovermethod,
|
|
56 $epel_source_proxy = $epel::params::epel_source_proxy,
|
|
57 $epel_source_enabled = $epel::params::epel_source_enabled,
|
|
58 $epel_source_gpgcheck = $epel::params::epel_source_gpgcheck,
|
|
59 $epel_source_repo_gpgcheck = $epel::params::epel_source_repo_gpgcheck,
|
|
60 $epel_source_metalink = $epel::params::epel_source_metalink,
|
|
61 Boolean $epel_source_managed = true,
|
|
62 $epel_source_exclude = undef,
|
|
63 $epel_source_includepkgs = undef,
|
|
64 $epel_source_sslclientkey = undef,
|
|
65 $epel_source_sslclientcert = undef,
|
|
66 Optional[String[1]] $epel_source_username = undef,
|
|
67 Optional[String[1]] $epel_source_password = undef,
|
|
68 $epel_debuginfo_mirrorlist = $epel::params::epel_debuginfo_mirrorlist,
|
|
69 $epel_debuginfo_baseurl = $epel::params::epel_debuginfo_baseurl,
|
|
70 $epel_debuginfo_failovermethod = $epel::params::epel_debuginfo_failovermethod,
|
|
71 $epel_debuginfo_proxy = $epel::params::epel_debuginfo_proxy,
|
|
72 $epel_debuginfo_enabled = $epel::params::epel_debuginfo_enabled,
|
|
73 $epel_debuginfo_gpgcheck = $epel::params::epel_debuginfo_gpgcheck,
|
|
74 $epel_debuginfo_repo_gpgcheck = $epel::params::epel_debuginfo_repo_gpgcheck,
|
|
75 $epel_debuginfo_metalink = $epel::params::epel_debuginfo_metalink,
|
|
76 Boolean $epel_debuginfo_managed = true,
|
|
77 $epel_debuginfo_exclude = undef,
|
|
78 $epel_debuginfo_includepkgs = undef,
|
|
79 $epel_debuginfo_sslclientkey = undef,
|
|
80 $epel_debuginfo_sslclientcert = undef,
|
|
81 Optional[String[1]] $epel_debuginfo_username = undef,
|
|
82 Optional[String[1]] $epel_debuginfo_password = undef,
|
|
83 $epel_testing_source_mirrorlist = $epel::params::epel_testing_source_mirrorlist,
|
|
84 $epel_testing_source_baseurl = $epel::params::epel_testing_source_baseurl,
|
|
85 $epel_testing_source_failovermethod = $epel::params::epel_testing_source_failovermethod,
|
|
86 $epel_testing_source_proxy = $epel::params::epel_testing_source_proxy,
|
|
87 $epel_testing_source_enabled = $epel::params::epel_testing_source_enabled,
|
|
88 $epel_testing_source_gpgcheck = $epel::params::epel_testing_source_gpgcheck,
|
|
89 $epel_testing_source_repo_gpgcheck = $epel::params::epel_testing_source_repo_gpgcheck,
|
|
90 $epel_testing_source_metalink = $epel::params::epel_testing_source_metalink,
|
|
91 Boolean $epel_testing_source_managed = true,
|
|
92 $epel_testing_source_exclude = undef,
|
|
93 $epel_testing_source_includepkgs = undef,
|
|
94 $epel_testing_source_sslclientkey = undef,
|
|
95 $epel_testing_source_sslclientcert = undef,
|
|
96 Optional[String[1]] $epel_testing_source_username = undef,
|
|
97 Optional[String[1]] $epel_testing_source_password = undef,
|
|
98 $epel_testing_debuginfo_mirrorlist = $epel::params::epel_testing_debuginfo_mirrorlist,
|
|
99 $epel_testing_debuginfo_baseurl = $epel::params::epel_testing_debuginfo_baseurl,
|
|
100 $epel_testing_debuginfo_failovermethod = $epel::params::epel_testing_debuginfo_failovermethod,
|
|
101 $epel_testing_debuginfo_proxy = $epel::params::epel_testing_debuginfo_proxy,
|
|
102 $epel_testing_debuginfo_enabled = $epel::params::epel_testing_debuginfo_enabled,
|
|
103 $epel_testing_debuginfo_gpgcheck = $epel::params::epel_testing_debuginfo_gpgcheck,
|
|
104 $epel_testing_debuginfo_repo_gpgcheck = $epel::params::epel_testing_debuginfo_repo_gpgcheck,
|
|
105 $epel_testing_debuginfo_metalink = $epel::params::epel_testing_debuginfo_metalink,
|
|
106 Boolean $epel_testing_debuginfo_managed = true,
|
|
107 $epel_testing_debuginfo_exclude = undef,
|
|
108 $epel_testing_debuginfo_includepkgs = undef,
|
|
109 $epel_testing_debuginfo_sslclientkey = undef,
|
|
110 $epel_testing_debuginfo_sslclientcert = undef,
|
|
111 Optional[String[1]] $epel_testing_debuginfo_username = undef,
|
|
112 Optional[String[1]] $epel_testing_debuginfo_password = undef,
|
|
113 Boolean $epel_gpg_managed = true,
|
|
114 $os_maj_release = $epel::params::os_maj_release,
|
272
|
115 ) inherits epel::params {
|
387
|
116 if $facts['os']['family'] == 'RedHat' and $facts['os']['name'] != 'Fedora' {
|
|
117 if $epel_testing_managed {
|
|
118 yumrepo { 'epel-testing':
|
|
119 # lint:ignore:selector_inside_resource
|
|
120 mirrorlist => $epel_testing_baseurl ? {
|
|
121 'absent' => $epel_testing_mirrorlist,
|
|
122 default => 'absent',
|
|
123 },
|
|
124 # lint:endignore
|
|
125 baseurl => $epel_testing_baseurl,
|
|
126 failovermethod => $epel_testing_failovermethod,
|
|
127 proxy => $epel_testing_proxy,
|
|
128 enabled => $epel_testing_enabled,
|
|
129 gpgcheck => $epel_testing_gpgcheck,
|
|
130 repo_gpgcheck => $epel_testing_repo_gpgcheck,
|
|
131 gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}",
|
|
132 metalink => $epel_testing_metalink,
|
|
133 descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch",
|
|
134 exclude => $epel_testing_exclude,
|
|
135 includepkgs => $epel_testing_includepkgs,
|
|
136 sslclientkey => $epel_testing_sslclientkey,
|
|
137 sslclientcert => $epel_testing_sslclientcert,
|
|
138 username => $epel_testing_username,
|
|
139 password => $epel_testing_password,
|
|
140 }
|
272
|
141
|
387
|
142 if $epel_gpg_managed {
|
|
143 Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-testing']
|
|
144 }
|
272
|
145 }
|
|
146
|
387
|
147 if $epel_testing_debuginfo_managed {
|
|
148 yumrepo { 'epel-testing-debuginfo':
|
|
149 # lint:ignore:selector_inside_resource
|
|
150 mirrorlist => $epel_testing_debuginfo_baseurl ? {
|
|
151 'absent' => $epel_testing_debuginfo_mirrorlist,
|
|
152 default => 'absent',
|
|
153 },
|
|
154 # lint:endignore
|
|
155 baseurl => $epel_testing_debuginfo_baseurl,
|
|
156 failovermethod => $epel_testing_debuginfo_failovermethod,
|
|
157 proxy => $epel_testing_debuginfo_proxy,
|
|
158 enabled => $epel_testing_debuginfo_enabled,
|
|
159 gpgcheck => $epel_testing_debuginfo_gpgcheck,
|
|
160 repo_gpgcheck => $epel_testing_debuginfo_repo_gpgcheck,
|
|
161 gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}",
|
|
162 metalink => $epel_testing_debuginfo_metalink,
|
|
163 descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch - Debug",
|
|
164 exclude => $epel_testing_debuginfo_exclude,
|
|
165 includepkgs => $epel_testing_debuginfo_includepkgs,
|
|
166 sslclientkey => $epel_testing_debuginfo_sslclientkey,
|
|
167 sslclientcert => $epel_testing_debuginfo_sslclientcert,
|
|
168 username => $epel_testing_debuginfo_username,
|
|
169 password => $epel_testing_debuginfo_password,
|
|
170 }
|
|
171
|
|
172 if $epel_gpg_managed {
|
|
173 Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-testing-debuginfo']
|
|
174 }
|
272
|
175 }
|
387
|
176
|
|
177 if $epel_testing_source_managed {
|
|
178 yumrepo { 'epel-testing-source':
|
|
179 # lint:ignore:selector_inside_resource
|
|
180 mirrorlist => $epel_testing_source_baseurl ? {
|
|
181 'absent' => $epel_testing_source_mirrorlist,
|
|
182 default => 'absent',
|
|
183 },
|
|
184 # lint:endignore
|
|
185 baseurl => $epel_testing_source_baseurl,
|
|
186 failovermethod => $epel_testing_source_failovermethod,
|
|
187 proxy => $epel_testing_source_proxy,
|
|
188 enabled => $epel_testing_source_enabled,
|
|
189 gpgcheck => $epel_testing_source_gpgcheck,
|
|
190 repo_gpgcheck => $epel_testing_source_repo_gpgcheck,
|
|
191 gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}",
|
|
192 metalink => $epel_testing_source_metalink,
|
|
193 descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch - Source",
|
|
194 exclude => $epel_testing_source_exclude,
|
|
195 includepkgs => $epel_testing_source_includepkgs,
|
|
196 sslclientkey => $epel_testing_source_sslclientkey,
|
|
197 sslclientcert => $epel_testing_source_sslclientcert,
|
|
198 username => $epel_testing_source_username,
|
|
199 password => $epel_testing_source_password,
|
|
200 }
|
|
201
|
|
202 if $epel_gpg_managed {
|
|
203 Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-testing-source']
|
|
204 }
|
|
205 }
|
272
|
206
|
387
|
207 if $epel_managed {
|
|
208 yumrepo { 'epel':
|
|
209 # lint:ignore:selector_inside_resource
|
|
210 mirrorlist => $epel_baseurl ? {
|
|
211 'absent' => $epel_mirrorlist,
|
|
212 default => 'absent',
|
|
213 },
|
|
214 # lint:endignore
|
|
215 baseurl => $epel_baseurl,
|
|
216 failovermethod => $epel_failovermethod,
|
|
217 proxy => $epel_proxy,
|
|
218 enabled => $epel_enabled,
|
|
219 gpgcheck => $epel_gpgcheck,
|
|
220 repo_gpgcheck => $epel_repo_gpgcheck,
|
|
221 gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}",
|
|
222 metalink => $epel_metalink,
|
|
223 descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch",
|
|
224 exclude => $epel_exclude,
|
|
225 includepkgs => $epel_includepkgs,
|
|
226 sslclientkey => $epel_sslclientkey,
|
|
227 sslclientcert => $epel_sslclientcert,
|
|
228 username => $epel_username,
|
|
229 password => $epel_password,
|
|
230 }
|
|
231
|
|
232 if $epel_gpg_managed {
|
|
233 Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel']
|
|
234 }
|
272
|
235 }
|
387
|
236
|
|
237 if $epel_debuginfo_managed {
|
|
238 yumrepo { 'epel-debuginfo':
|
|
239 # lint:ignore:selector_inside_resource
|
|
240 mirrorlist => $epel_debuginfo_baseurl ? {
|
|
241 'absent' => $epel_debuginfo_mirrorlist,
|
|
242 default => 'absent',
|
|
243 },
|
|
244 # lint:endignore
|
|
245 baseurl => $epel_debuginfo_baseurl,
|
|
246 failovermethod => $epel_debuginfo_failovermethod,
|
|
247 proxy => $epel_debuginfo_proxy,
|
|
248 enabled => $epel_debuginfo_enabled,
|
|
249 gpgcheck => $epel_debuginfo_gpgcheck,
|
|
250 repo_gpgcheck => $epel_debuginfo_repo_gpgcheck,
|
|
251 gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}",
|
|
252 descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch - Debug",
|
|
253 metalink => $epel_debuginfo_metalink,
|
|
254 exclude => $epel_debuginfo_exclude,
|
|
255 includepkgs => $epel_debuginfo_includepkgs,
|
|
256 sslclientkey => $epel_debuginfo_sslclientkey,
|
|
257 sslclientcert => $epel_debuginfo_sslclientcert,
|
|
258 username => $epel_debuginfo_username,
|
|
259 password => $epel_debuginfo_password,
|
|
260 }
|
|
261
|
|
262 if $epel_gpg_managed {
|
|
263 Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-debuginfo']
|
|
264 }
|
|
265 }
|
|
266
|
|
267 if $epel_source_managed {
|
|
268 yumrepo { 'epel-source':
|
|
269 # lint:ignore:selector_inside_resource
|
|
270 mirrorlist => $epel_source_baseurl ? {
|
|
271 'absent' => $epel_source_mirrorlist,
|
|
272 default => 'absent',
|
|
273 },
|
|
274 # lint:endignore
|
|
275 baseurl => $epel_source_baseurl,
|
|
276 failovermethod => $epel_source_failovermethod,
|
|
277 proxy => $epel_source_proxy,
|
|
278 enabled => $epel_source_enabled,
|
|
279 gpgcheck => $epel_source_gpgcheck,
|
|
280 repo_gpgcheck => $epel_source_repo_gpgcheck,
|
|
281 gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}",
|
|
282 descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch - Source",
|
|
283 metalink => $epel_source_metalink,
|
|
284 exclude => $epel_source_exclude,
|
|
285 includepkgs => $epel_source_includepkgs,
|
|
286 sslclientkey => $epel_source_sslclientkey,
|
|
287 sslclientcert => $epel_source_sslclientcert,
|
|
288 username => $epel_source_username,
|
|
289 password => $epel_source_password,
|
|
290 }
|
|
291
|
|
292 if $epel_gpg_managed {
|
|
293 Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-source']
|
|
294 }
|
|
295 }
|
|
296
|
|
297 if $epel_gpg_managed {
|
|
298 file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}":
|
|
299 ensure => file,
|
|
300 owner => 'root',
|
|
301 group => 'root',
|
|
302 mode => '0644',
|
|
303 content => file("epel/RPM-GPG-KEY-EPEL-${os_maj_release}"),
|
|
304 }
|
|
305
|
|
306 epel::rpm_gpg_key { "EPEL-${os_maj_release}":
|
|
307 path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}",
|
|
308 }
|
|
309 }
|
272
|
310 } else {
|
387
|
311 notice ("Your operating system ${facts['os']['name']} will not have the EPEL repository applied")
|
272
|
312 }
|
|
313 }
|