comparison modules/apt/README.md @ 478:adf6fe9bbc17

Update Puppet modules to latest versions
author IBBoard <dev@ibboard.co.uk>
date Thu, 29 Aug 2024 18:47:29 +0100
parents 3fce34f642f1
children
comparison
equal deleted inserted replaced
477:21f6add30502 478:adf6fe9bbc17
14 * [Add a Personal Package Archive repository](#add-a-personal-package-archive-repository) 14 * [Add a Personal Package Archive repository](#add-a-personal-package-archive-repository)
15 * [Configure Apt from Hiera](#configure-apt-from-hiera) 15 * [Configure Apt from Hiera](#configure-apt-from-hiera)
16 * [Replace the default sources.list file](#replace-the-default-sourceslist-file) 16 * [Replace the default sources.list file](#replace-the-default-sourceslist-file)
17 1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) 17 1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
18 1. [Limitations - OS compatibility, etc.](#limitations) 18 1. [Limitations - OS compatibility, etc.](#limitations)
19 1. [License](#license)
19 1. [Development - Guide for contributing to the module](#development) 20 1. [Development - Guide for contributing to the module](#development)
20 21
21 <a id="module-description"></a> 22 <a id="module-description"></a>
22 23
23 ## Module Description 24 ## Module Description
64 65
65 <a id="add-gpg-keys"></a> 66 <a id="add-gpg-keys"></a>
66 67
67 ### Add GPG keys 68 ### Add GPG keys
68 69
70 You can fetch GPG keys via HTTP, Puppet URI, or local filesystem. The key can be in GPG binary format, or ASCII armored, but the filename should have the appropriate extension (`.gpg` for keys in binary format; or `.asc` for ASCII armored keys).
71
72 #### Fetch via HTTP
73
74 ```puppet
75 apt::keyring { 'puppetlabs-keyring.gpg':
76 source => 'https://apt.puppetlabs.com/keyring.gpg',
77 }
78 ```
79
80 #### Fetch via Puppet URI
81
82 ```puppet
83 apt::keyring { 'puppetlabs-keyring.gpg':
84 source => 'puppet:///modules/my_module/local_puppetlabs-keyring.gpg',
85 }
86 ```
87
88 Alternatively `apt::key` can be used.
89
90 **Warning** `apt::key` is deprecated in the latest Debian and Ubuntu releases. Please use apt::keyring instead.
91
69 **Warning:** Using short key IDs presents a serious security issue, potentially leaving you open to collision attacks. We recommend you always use full fingerprints to identify your GPG keys. This module allows short keys, but issues a security warning if you use them. 92 **Warning:** Using short key IDs presents a serious security issue, potentially leaving you open to collision attacks. We recommend you always use full fingerprints to identify your GPG keys. This module allows short keys, but issues a security warning if you use them.
70 93
71 Declare the `apt::key` defined type: 94 Declare the `apt::key` defined type:
72 95
73 ```puppet 96 ```puppet
94 117
95 <a id="update-the-list-of-packages"></a> 118 <a id="update-the-list-of-packages"></a>
96 119
97 ### Update the list of packages 120 ### Update the list of packages
98 121
99 By default, Puppet runs `apt-get update` on the first Puppet run after you include the `apt` class, and anytime `notify => Exec['apt_update']` occurs; i.e., whenever config files get updated or other relevant changes occur. If you set `update['frequency']` to 'always', the update runs on every Puppet run. You can also set `update['frequency']` to 'daily' or 'weekly': 122 By default, Puppet runs `apt-get update` on the first Puppet run after you include the `apt` class, and anytime `notify => Exec['apt_update']` occurs; i.e., whenever config files get updated or other relevant changes occur. If you set `update['frequency']` to 'always', the update runs on every Puppet run. You can also set `update['frequency']` to 'hourly', 'daily', 'weekly' or any integer value >= 60:
100 123
101 ```puppet 124 ```puppet
102 class { 'apt': 125 class { 'apt':
103 update => { 126 update => {
104 frequency => 'daily', 127 frequency => 'daily',
178 location => 'http://apt.puppetlabs.com', 201 location => 'http://apt.puppetlabs.com',
179 repos => 'main', 202 repos => 'main',
180 key => { 203 key => {
181 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F', 204 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
182 'server' => 'pgp.mit.edu', 205 'server' => 'pgp.mit.edu',
206 },
207 }
208 ```
209
210 ### Adding name and source to the key parameter of apt::source, which then manages modern apt gpg keyrings
211
212 The `name` parameter of key hash should contain the filename with extension (such as `puppetlabs.gpg`).
213
214 ```puppet
215 apt::source { 'puppetlabs':
216 comment => 'Puppet8',
217 location => 'https://apt.puppetlabs.com/',
218 repos => 'puppet8',
219 key => {
220 'name' => 'puppetlabs.gpg',
221 'source' => 'https://apt.puppetlabs.com/keyring.gpg',
183 }, 222 },
184 } 223 }
185 ``` 224 ```
186 225
187 <a id="configure-apt-from-hiera"></a> 226 <a id="configure-apt-from-hiera"></a>
317 356
318 ```puppet 357 ```puppet
319 Class['apt::update'] -> Package <| provider == 'apt' |> 358 Class['apt::update'] -> Package <| provider == 'apt' |>
320 ``` 359 ```
321 360
361 ## License
362
363 This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://opensource.org/license/agpl-v3/), [BSD-2](https://opensource.org/license/bsd-2-clause/), [BSD-3](https://opensource.org/license/bsd-3-clause/), [GPL2.0](https://opensource.org/license/gpl-2-0/), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing.
364
322 ## Development 365 ## Development
323 366
324 Acceptance tests for this module leverage [puppet_litmus](https://github.com/puppetlabs/puppet_litmus). 367 Acceptance tests for this module leverage [puppet_litmus](https://github.com/puppetlabs/puppet_litmus).
325 To run the acceptance tests follow the instructions [here](https://puppetlabs.github.io/litmus/Running-acceptance-tests.html). 368 To run the acceptance tests follow the instructions [here](https://puppetlabs.github.io/litmus/Running-acceptance-tests.html).
326 You can also find a tutorial and walkthrough of using Litmus and the PDK on [YouTube](https://www.youtube.com/watch?v=FYfR7ZEGHoE). 369 You can also find a tutorial and walkthrough of using Litmus and the PDK on [YouTube](https://www.youtube.com/watch?v=FYfR7ZEGHoE).
327 370
328 If you run into an issue with this module, or if you would like to request a feature, please [file a ticket](https://tickets.puppetlabs.com/browse/MODULES/). 371 If you run into an issue with this module, or if you would like to request a feature, please [file a ticket](https://github.com/puppetlabs/puppetlabs-apt/issues).
329 Every Monday the Puppet IA Content Team has [office hours](https://puppet.com/community/office-hours) in the [Puppet Community Slack](http://slack.puppet.com/), alternating between an EMEA friendly time (1300 UTC) and an Americas friendly time (0900 Pacific, 1700 UTC). 372 Every Monday the Puppet IA Content Team has [office hours](https://puppet.com/community/office-hours) in the [Puppet Community Slack](http://slack.puppet.com/), alternating between an EMEA friendly time (1300 UTC) and an Americas friendly time (0900 Pacific, 1700 UTC).
330 373
331 If you have problems getting this module up and running, please [contact Support](http://puppetlabs.com/services/customer-support). 374 If you have problems getting this module up and running, please [contact Support](http://puppetlabs.com/services/customer-support).
332 375
333 If you submit a change to this module, be sure to regenerate the reference documentation as follows: 376 If you submit a change to this module, be sure to regenerate the reference documentation as follows: