Mercurial > repos > other > Puppet
annotate 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 |
rev | line source |
---|---|
386
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 # apt |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 #### Table of Contents |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 1. [Module Description - What the module does and why it is useful](#module-description) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 1. [Setup - The basics of getting started with apt](#setup) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 * [What apt affects](#what-apt-affects) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 * [Beginning with apt](#beginning-with-apt) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 1. [Usage - Configuration options and additional functionality](#usage) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 * [Add GPG keys](#add-gpg-keys) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 * [Prioritize backports](#prioritize-backports) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 * [Update the list of packages](#update-the-list-of-packages) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 * [Pin a specific release](#pin-a-specific-release) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 * [Add a Personal Package Archive repository](#add-a-personal-package-archive-repository) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 * [Configure Apt from Hiera](#configure-apt-from-hiera) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 * [Replace the default sources.list file](#replace-the-default-sourceslist-file) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 1. [Limitations - OS compatibility, etc.](#limitations) |
478
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
19 1. [License](#license) |
386
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 1. [Development - Guide for contributing to the module](#development) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 <a id="module-description"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 ## Module Description |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 The apt module lets you use Puppet to manage APT (Advanced Package Tool) sources, keys, and other configuration options. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 APT is a package manager available on Debian, Ubuntu, and several other operating systems. The apt module provides a series of classes, defines, types, and facts to help you automate APT package management. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 **Note**: Prior to Puppet 7, for this module to correctly autodetect which version of |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 Debian/Ubuntu (or derivative) you're running, you need to make sure the `lsb-release` package is |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 installed. With Puppet 7 the `lsb-release` package is not needed. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
34 <a id="setup"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
35 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
36 ## Setup |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
37 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
38 <a id="what-apt-affects"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
39 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
40 ### What apt affects |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
41 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
42 * Your system's `preferences` file and `preferences.d` directory |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
43 * Your system's `sources.list` file and `sources.list.d` directory |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
44 * Your system's `apt.conf.d` directory |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
45 * System repositories |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
46 * Authentication keys |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
47 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
48 **Note:** This module offers `purge` parameters which, if set to `true`, **destroy** any configuration on the node's `sources.list(.d)`, `preferences(.d)` and `apt.conf.d` that you haven't declared through Puppet. The default for these parameters is `false`. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
49 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
50 <a id="beginning-with-apt"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
51 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
52 ### Beginning with apt |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
53 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
54 To use the apt module with default parameters, declare the `apt` class. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
55 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
56 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
57 include apt |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
58 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
59 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
60 **Note:** The main `apt` class is required by all other classes, types, and defined types in this module. You must declare it whenever you use the module. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
61 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
62 <a id="usage"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
63 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
64 ## Usage |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
65 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
66 <a id="add-gpg-keys"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
67 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
68 ### Add GPG keys |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
69 |
478
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
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). |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
71 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
72 #### Fetch via HTTP |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
73 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
74 ```puppet |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
75 apt::keyring { 'puppetlabs-keyring.gpg': |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
76 source => 'https://apt.puppetlabs.com/keyring.gpg', |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
77 } |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
78 ``` |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
79 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
80 #### Fetch via Puppet URI |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
81 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
82 ```puppet |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
83 apt::keyring { 'puppetlabs-keyring.gpg': |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
84 source => 'puppet:///modules/my_module/local_puppetlabs-keyring.gpg', |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
85 } |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
86 ``` |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
87 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
88 Alternatively `apt::key` can be used. |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
89 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
90 **Warning** `apt::key` is deprecated in the latest Debian and Ubuntu releases. Please use apt::keyring instead. |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
91 |
386
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
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. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
93 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
94 Declare the `apt::key` defined type: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
95 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
96 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
97 apt::key { 'puppetlabs': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
98 id => '6F6B15509CF8E59E6E469F327F438280EF8D349F', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
99 server => 'pgp.mit.edu', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
100 options => 'http-proxy="http://proxyuser:proxypass@example.org:3128"', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
101 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
102 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
103 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
104 <a id="prioritize-backports"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
105 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
106 ### Prioritize backports |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
107 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
108 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
109 class { 'apt::backports': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
110 pin => 500, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
111 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
112 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
113 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
114 By default, the `apt::backports` class drops a pin file for backports, pinning it to a priority of 200. This is lower than the normal default of 500, so packages with `ensure => latest` don't get upgraded from backports without your explicit permission. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
115 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
116 If you raise the priority through the `pin` parameter to 500, normal policy goes into effect and Apt installs or upgrades to the newest version. This means that if a package is available from backports, it and its dependencies are pulled in from backports unless you explicitly set the `ensure` attribute of the `package` resource to `installed`/`present` or a specific version. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
117 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
118 <a id="update-the-list-of-packages"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
119 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
120 ### Update the list of packages |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
121 |
478
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
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: |
386
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
123 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
124 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
125 class { 'apt': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
126 update => { |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
127 frequency => 'daily', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
128 }, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
129 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
130 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
131 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
132 When `Exec['apt_update']` is triggered, it generates a `notice`-level message. Because the default [logging level for agents](https://puppet.com/docs/puppet/latest/configuration.html#loglevel) is `notice`, this causes the repository update to appear in agent logs. To silence these updates from the default log output, set the [loglevel](https://puppet.com/docs/puppet/latest/metaparameter.html#loglevel) metaparameter for `Exec['apt_update']` above the agent logging level: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
133 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
134 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
135 class { 'apt': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
136 update => { |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
137 frequency => 'daily', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
138 loglevel => 'debug', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
139 }, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
140 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
141 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
142 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
143 > **NOTE:** Every `Exec['apt_update']` run will generate a corrective change, even if the apt caches are not updated. For example, setting an update frequency of `always` can result in every Puppet run resulting in a corrective change. This is a known issue. For details, see [MODULES-10763](https://tickets.puppetlabs.com/browse/MODULES-10763). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
144 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
145 <a id="pin-a-specific-release"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
146 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
147 ### Pin a specific release |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
148 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
149 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
150 apt::pin { 'karmic': priority => 700 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
151 apt::pin { 'karmic-updates': priority => 700 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
152 apt::pin { 'karmic-security': priority => 700 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
153 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
154 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
155 You can also specify more complex pins using distribution properties: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
156 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
157 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
158 apt::pin { 'stable': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
159 priority => -10, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
160 originator => 'Debian', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
161 release_version => '3.0', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
162 component => 'main', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
163 label => 'Debian' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
164 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
165 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
166 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
167 To pin multiple packages, pass them to the `packages` parameter as an array or a space-delimited string. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
168 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
169 <a id="add-a-personal-package-archive-repository"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
170 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
171 ### Add a Personal Package Archive (PPA) repository |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
172 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
173 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
174 apt::ppa { 'ppa:drizzle-developers/ppa': } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
175 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
176 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
177 ### Add an Apt source to `/etc/apt/sources.list.d/` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
178 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
179 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
180 apt::source { 'debian_unstable': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
181 comment => 'This is the iWeb Debian unstable mirror', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
182 location => 'http://debian.mirror.iweb.ca/debian/', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
183 release => 'unstable', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
184 repos => 'main contrib non-free', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
185 pin => '-10', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
186 key => { |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
187 'id' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
188 'server' => 'subkeys.pgp.net', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
189 }, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
190 include => { |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
191 'src' => true, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
192 'deb' => true, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
193 }, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
194 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
195 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
196 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
197 To use the Puppet Apt repository as a source: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
198 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
199 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
200 apt::source { 'puppetlabs': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
201 location => 'http://apt.puppetlabs.com', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
202 repos => 'main', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
203 key => { |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
204 'id' => '6F6B15509CF8E59E6E469F327F438280EF8D349F', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
205 'server' => 'pgp.mit.edu', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
206 }, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
207 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
208 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
209 |
478
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
210 ### Adding name and source to the key parameter of apt::source, which then manages modern apt gpg keyrings |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
211 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
212 The `name` parameter of key hash should contain the filename with extension (such as `puppetlabs.gpg`). |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
213 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
214 ```puppet |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
215 apt::source { 'puppetlabs': |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
216 comment => 'Puppet8', |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
217 location => 'https://apt.puppetlabs.com/', |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
218 repos => 'puppet8', |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
219 key => { |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
220 'name' => 'puppetlabs.gpg', |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
221 'source' => 'https://apt.puppetlabs.com/keyring.gpg', |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
222 }, |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
223 } |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
224 ``` |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
225 |
386
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
226 <a id="configure-apt-from-hiera"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
227 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
228 ### Configure Apt from Hiera |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
229 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
230 Instead of specifying your sources directly as resources, you can instead just include the `apt` class, which will pick up the values automatically from hiera. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
231 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
232 ```yaml |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
233 apt::sources: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
234 'debian_unstable': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
235 comment: 'This is the iWeb Debian unstable mirror' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
236 location: 'http://debian.mirror.iweb.ca/debian/' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
237 release: 'unstable' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
238 repos: 'main contrib non-free' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
239 pin: '-10' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
240 key: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
241 id: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
242 server: 'subkeys.pgp.net' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
243 include: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
244 src: true |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
245 deb: true |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
246 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
247 'puppetlabs': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
248 location: 'http://apt.puppetlabs.com' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
249 repos: 'main' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
250 key: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
251 id: '6F6B15509CF8E59E6E469F327F438280EF8D349F' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
252 server: 'pgp.mit.edu' |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
253 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
254 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
255 <a id="replace-the-default-sourceslist-file"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
256 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
257 ### Replace the default `sources.list` file |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
258 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
259 The following example replaces the default `/etc/apt/sources.list`. Along with this code, be sure to use the `purge` parameter, or you might get duplicate source warnings when running Apt. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
260 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
261 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
262 apt::source { "archive.ubuntu.com-${facts['os']['distro']['codename']}": |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
263 location => 'http://archive.ubuntu.com/ubuntu', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
264 key => '630239CC130E1A7FD81A27B140976EAF437D05B5', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
265 repos => 'main universe multiverse restricted', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
266 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
267 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
268 apt::source { "archive.ubuntu.com-${facts['os']['distro']['codename']}-security": |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
269 location => 'http://archive.ubuntu.com/ubuntu', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
270 key => '630239CC130E1A7FD81A27B140976EAF437D05B5', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
271 repos => 'main universe multiverse restricted', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
272 release => "${facts['os']['distro']['codename']}-security" |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
273 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
274 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
275 apt::source { "archive.ubuntu.com-${facts['os']['distro']['codename']}-updates": |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
276 location => 'http://archive.ubuntu.com/ubuntu', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
277 key => '630239CC130E1A7FD81A27B140976EAF437D05B5', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
278 repos => 'main universe multiverse restricted', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
279 release => "${facts['os']['distro']['codename']}-updates" |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
280 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
281 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
282 apt::source { "archive.ubuntu.com-${facts['os']['distro']['codename']}-backports": |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
283 location => 'http://archive.ubuntu.com/ubuntu', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
284 key => '630239CC130E1A7FD81A27B140976EAF437D05B5', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
285 repos => 'main universe multiverse restricted', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
286 release => "${facts['os']['distro']['codename']}-backports" |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
287 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
288 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
289 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
290 ### Manage login configuration settings for an APT source or proxy in `/etc/apt/auth.conf` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
291 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
292 Starting with APT version 1.5, you can define login configuration settings, such as |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
293 username and password, for APT sources or proxies that require authentication |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
294 in the `/etc/apt/auth.conf` file. This is preferable to embedding login |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
295 information directly in `source.list` entries, which are usually world-readable. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
296 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
297 The `/etc/apt/auth.conf` file follows the format of netrc (used by ftp or |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
298 curl) and has restrictive file permissions. See [here](https://manpages.debian.org/testing/apt/apt_auth.conf.5.en.html) for details. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
299 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
300 Use the optional `apt::auth_conf_entries` parameter to specify an array of hashes containing login configuration settings. These hashes may only contain the `machine`, `login` and `password` keys. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
301 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
302 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
303 class { 'apt': |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
304 auth_conf_entries => [ |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
305 { |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
306 'machine' => 'apt-proxy.example.net', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
307 'login' => 'proxylogin', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
308 'password' => 'proxypassword', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
309 }, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
310 { |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
311 'machine' => 'apt.example.com/ubuntu', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
312 'login' => 'reader', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
313 'password' => 'supersecret', |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
314 }, |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
315 ], |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
316 } |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
317 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
318 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
319 <a id="reference"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
320 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
321 ## Reference |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
322 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
323 ### Facts |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
324 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
325 * `apt_updates`: The number of installed packages with available updates from `upgrade`. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
326 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
327 * `apt_dist_updates`: The number of installed packages with available updates from `dist-upgrade`. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
328 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
329 * `apt_security_updates`: The number of installed packages with available security updates from `upgrade`. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
330 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
331 * `apt_security_dist_updates`: The number of installed packages with available security updates from `dist-upgrade`. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
332 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
333 * `apt_package_updates`: The names of all installed packages with available updates from `upgrade`. In Facter 2.0 and later this data is formatted as an array; in earlier versions it is a comma-delimited string. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
334 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
335 * `apt_package_dist_updates`: The names of all installed packages with available updates from `dist-upgrade`. In Facter 2.0 and later this data is formatted as an array; in earlier versions it is a comma-delimited string. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
336 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
337 * `apt_update_last_success`: The date, in epochtime, of the most recent successful `apt-get update` run (based on the mtime of /var/lib/apt/periodic/update-success-stamp). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
338 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
339 * `apt_reboot_required`: Determines if a reboot is necessary after updates have been installed. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
340 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
341 ### More Information |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
342 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
343 See [REFERENCE.md](https://github.com/puppetlabs/puppetlabs-apt/blob/main/REFERENCE.md) for all other reference documentation. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
344 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
345 <a id="limitations"></a> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
346 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
347 ## Limitations |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
348 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
349 This module is not designed to be split across [run stages](https://docs.puppetlabs.com/puppet/latest/reference/lang_run_stages.html). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
350 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
351 For an extensive list of supported operating systems, see [metadata.json](https://github.com/puppetlabs/puppetlabs-apt/blob/main/metadata.json) |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
352 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
353 ### Adding new sources or PPAs |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
354 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
355 If you are adding a new source or PPA and trying to install packages from the new source or PPA on the same Puppet run, your `package` resource should depend on `Class['apt::update']`, as well as depending on the `Apt::Source` or the `Apt::Ppa`. You can also add [collectors](https://docs.puppetlabs.com/puppet/latest/reference/lang_collectors.html) to ensure that all packages happen after `apt::update`, but this can lead to dependency cycles and has implications for [virtual resources](https://docs.puppetlabs.com/puppet/latest/reference/lang_collectors.html#behavior). Before running the command below, ensure that all packages have the provider set to apt. |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
356 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
357 ```puppet |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
358 Class['apt::update'] -> Package <| provider == 'apt' |> |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
359 ``` |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
360 |
478
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
361 ## License |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
362 |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
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. |
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
364 |
386
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
365 ## Development |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
366 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
367 Acceptance tests for this module leverage [puppet_litmus](https://github.com/puppetlabs/puppet_litmus). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
368 To run the acceptance tests follow the instructions [here](https://puppetlabs.github.io/litmus/Running-acceptance-tests.html). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
369 You can also find a tutorial and walkthrough of using Litmus and the PDK on [YouTube](https://www.youtube.com/watch?v=FYfR7ZEGHoE). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
370 |
478
adf6fe9bbc17
Update Puppet modules to latest versions
IBBoard <dev@ibboard.co.uk>
parents:
386
diff
changeset
|
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). |
386
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
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). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
373 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
374 If you have problems getting this module up and running, please [contact Support](http://puppetlabs.com/services/customer-support). |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
375 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
376 If you submit a change to this module, be sure to regenerate the reference documentation as follows: |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
377 |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
378 ```bash |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
379 puppet strings generate --format markdown --out REFERENCE.md |
3fce34f642f1
Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
380 ``` |