File: REFERENCE.md

package info (click to toggle)
puppet-module-puppetlabs-apt 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 756 kB
  • sloc: ruby: 4,751; sh: 31; makefile: 2
file content (865 lines) | stat: -rw-r--r-- 21,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
# Reference
<!-- DO NOT EDIT: This document was generated by Puppet Strings -->

## Table of Contents

**Classes**

_Public Classes_

* [`apt`](#apt): Main class, includes all other classes.
* [`apt::backports`](#aptbackports): Manages backports.

_Private Classes_

* `apt::params`: Provides defaults for the Apt module parameters.
* `apt::update`: Updates the list of available packages using apt-get update.

**Defined types**

* [`apt::conf`](#aptconf): Specifies a custom Apt configuration file.
* [`apt::key`](#aptkey): Manages the GPG keys that Apt uses to authenticate packages.
* [`apt::pin`](#aptpin): Manages Apt pins. Does not trigger an apt-get update run.
* [`apt::ppa`](#aptppa): Manages PPA repositories using `add-apt-repository`. Not supported on Debian.
* [`apt::setting`](#aptsetting): Manages Apt configuration files.
* [`apt::source`](#aptsource): Manages the Apt sources in /etc/apt/sources.list.d/.

**Resource types**

_Public Resource types_


_Private Resource types_

* `apt_key`: This type provides Puppet with the capabilities to manage GPG keys needed
by apt to perform package validation. Apt has it's own GPG keyring that can
be manipulated through the `apt-key` command.

**Tasks**

* [`init`](#init): Allows you to perform apt functions

## Classes

### apt

Main class, includes all other classes.

* **See also**
https://docs.puppetlabs.com/references/latest/function.html#createresources
for the create resource function

#### Parameters

The following parameters are available in the `apt` class.

##### `provider`

Data type: `String`

Specifies the provider that should be used by apt::update.

Default value: $apt::params::provider

##### `keyserver`

Data type: `String`

Specifies a keyserver to provide the GPG key. Valid options: a string containing a domain name or a full URL (http://, https://, or
hkp://).

Default value: $apt::params::keyserver

##### `ppa_options`

Data type: `Optional[String]`

Supplies options to be passed to the `add-apt-repository` command.

Default value: $apt::params::ppa_options

##### `ppa_package`

Data type: `Optional[String]`

Names the package that provides the `apt-add-repository` command.

Default value: $apt::params::ppa_package

##### `backports`

Data type: `Optional[Hash]`

Specifies some of the default parameters used by apt::backports. Valid options: a hash made up from the following keys:

Options:

* **:location** `String`: See apt::backports for documentation.
* **:repos** `String`: See apt::backports for documentation.
* **:key** `String`: See apt::backports for documentation.

Default value: $apt::params::backports

##### `confs`

Data type: `Hash`

Creates new `apt::conf` resources. Valid options: a hash to be passed to the create_resources function linked above.

Default value: $apt::params::confs

##### `update`

Data type: `Hash`

Configures various update settings. Valid options: a hash made up from the following keys:

Options:

* **:frequency** `String`: Specifies how often to run `apt-get update`. If the exec resource `apt_update` is notified, `apt-get update` runs regardless of this value.
Valid options: 'always' (at every Puppet run); 'daily' (if the value of `apt_update_last_success` is less than current epoch time minus 86400);
'weekly' (if the value of `apt_update_last_success` is less than current epoch time minus 604800); and 'reluctantly' (only if the exec resource
`apt_update` is notified). Default: 'reluctantly'.
* **:loglevel** `Integer`: Specifies the log level of logs outputted to the console. Default: undef.
* **:timeout** `Integer`: Specifies how long to wait for the update to complete before canceling it. Valid options: an integer, in seconds. Default: undef.
* **:tries** `Integer`: Specifies how many times to retry the update after receiving a DNS or HTTP error. Default: undef.

Default value: $apt::params::update

##### `purge`

Data type: `Hash`

Specifies whether to purge any existing settings that aren't managed by Puppet. Valid options: a hash made up from the following keys:

Options:

* **:sources.list** `Boolean`: Specifies whether to purge any unmanaged entries from sources.list. Default false.
* **:sources.list.d** `Boolean`: Specifies whether to purge any unmanaged entries from sources.list.d. Default false.
* **:preferences** `Boolean`: Specifies whether to purge any unmanaged entries from preferences. Default false.
* **:preferences.d.** `Boolean`: Specifies whether to purge any unmanaged entries from preferences.d. Default false.

Default value: $apt::params::purge

##### `proxy`

Data type: `Apt::Proxy`

Configures Apt to connect to a proxy server. Valid options: a hash matching the locally defined type apt::proxy.

Default value: $apt::params::proxy

##### `sources`

Data type: `Hash`

Creates new `apt::source` resources. Valid options: a hash to be passed to the create_resources function linked above.

Default value: $apt::params::sources

##### `keys`

Data type: `Hash`

Creates new `apt::key` resources. Valid options: a hash to be passed to the create_resources function linked above.

Default value: $apt::params::keys

##### `ppas`

Data type: `Hash`

Creates new `apt::ppa` resources. Valid options: a hash to be passed to the create_resources function linked above.

Default value: $apt::params::ppas

##### `pins`

Data type: `Hash`

Creates new `apt::pin` resources. Valid options: a hash to be passed to the create_resources function linked above.

Default value: $apt::params::pins

##### `settings`

Data type: `Hash`

Creates new `apt::setting` resources. Valid options: a hash to be passed to the create_resources function linked above.

Default value: $apt::params::settings

##### `auth_conf_entries`

Data type: `Array[Apt::Auth_conf_entry]`

An optional array of login configuration settings (hashes) that are recorded in the file /etc/apt/auth.conf. This file has a netrc-like
format (similar to what curl uses) and contains the login configuration for APT sources and proxies that require authentication. See
https://manpages.debian.org/testing/apt/apt_auth.conf.5.en.html for details. If specified each hash must contain the keys machine, login and
password and no others.

Default value: $apt::params::auth_conf_entries

##### `root`

Data type: `String`

Specifies root directory of Apt executable.

Default value: $apt::params::root

##### `sources_list`

Data type: `String`

Specifies the path of the sources_list file to use.

Default value: $apt::params::sources_list

##### `sources_list_d`

Data type: `String`

Specifies the path of the sources_list.d file to use.

Default value: $apt::params::sources_list_d

##### `conf_d`

Data type: `String`

Specifies the path of the conf.d file to use.

Default value: $apt::params::conf_d

##### `preferences`

Data type: `String`

Specifies the path of the preferences file to use.

Default value: $apt::params::preferences

##### `preferences_d`

Data type: `String`

Specifies the path of the preferences.d file to use.

Default value: $apt::params::preferences_d

##### `config_files`

Data type: `Hash`

A hash made up of the various configuration files used by Apt.

Default value: $apt::params::config_files

##### `update_defaults`

Data type: `Hash`



Default value: $apt::params::update_defaults

##### `purge_defaults`

Data type: `Hash`



Default value: $apt::params::purge_defaults

##### `proxy_defaults`

Data type: `Hash`



Default value: $apt::params::proxy_defaults

##### `include_defaults`

Data type: `Hash`



Default value: $apt::params::include_defaults

##### `source_key_defaults`

Data type: `Hash`



Default value: $apt::params::source_key_defaults

### apt::backports

Manages backports.

#### Examples

##### Set up a backport for linuxmint qiana

```puppet
apt::backports { 'qiana':
  location => 'http://us.archive.ubuntu.com/ubuntu',
  release  => 'trusty-backports',
  repos    => 'main universe multiverse restricted',
  key      => {
    id     => '630239CC130E1A7FD81A27B140976EAF437D05B5',
    server => 'hkps.pool.sks-keyservers.net',
  },
}
```

#### Parameters

The following parameters are available in the `apt::backports` class.

##### `location`

Data type: `Optional[String]`

Specifies an Apt repository containing the backports to manage. Valid options: a string containing a URL. Default value for Debian and
Ubuntu varies:

- Debian: 'http://deb.debian.org/debian'

- Ubuntu: 'http://archive.ubuntu.com/ubuntu'

Default value: `undef`

##### `release`

Data type: `Optional[String]`

Specifies a distribution of the Apt repository containing the backports to manage. Used in populating the `source.list` configuration file.
Default: on Debian and Ubuntu, '${lsbdistcodename}-backports'. We recommend keeping this default, except on other operating
systems.

Default value: `undef`

##### `repos`

Data type: `Optional[String]`

Specifies a component of the Apt repository containing the backports to manage. Used in populating the `source.list` configuration file.
Default value for Debian and Ubuntu varies:

- Debian: 'main contrib non-free'

- Ubuntu: 'main universe multiverse restricted'

Default value: `undef`

##### `key`

Data type: `Optional[Variant[String, Hash]]`

Specifies a key to authenticate the backports. Valid options: a string to be passed to the id parameter of the apt::key defined type, or a
hash of parameter => value pairs to be passed to apt::key's id, server, content, source, and/or options parameters. Default value
for Debian and Ubuntu varies:

- Debian: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553'

- Ubuntu: '630239CC130E1A7FD81A27B140976EAF437D05B5'

Default value: `undef`

##### `pin`

Data type: `Optional[Variant[Integer, String, Hash]]`

Specifies a pin priority for the backports. Valid options: a number or string to be passed to the `id` parameter of the `apt::pin` defined
type, or a hash of `parameter => value` pairs to be passed to `apt::pin`'s corresponding parameters.

Default value: 200

## Defined types

### apt::conf

Specifies a custom Apt configuration file.

#### Parameters

The following parameters are available in the `apt::conf` defined type.

##### `content`

Data type: `Optional[String]`

Required unless `ensure` is set to 'absent'. Directly supplies content for the configuration file.

Default value: `undef`

##### `ensure`

Data type: `Enum['present', 'absent']`

Specifies whether the configuration file should exist. Valid options: 'present' and 'absent'.

Default value: present

##### `priority`

Data type: `Variant[String, Integer]`

Determines the order in which Apt processes the configuration file. Files with lower priority numbers are loaded first.
Valid options: a string containing an integer or an integer.

Default value: 50

##### `notify_update`

Data type: `Optional[Boolean]`

Specifies whether to trigger an `apt-get update` run.

Default value: `undef`

### apt::key

Manages the GPG keys that Apt uses to authenticate packages.

* **Note** The apt::key defined type makes use of the apt_key type, but includes extra functionality to help prevent duplicate keys.

#### Examples

##### Declare Apt key for apt.puppetlabs.com source

```puppet
apt::key { 'puppetlabs':
  id      => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
  server  => 'hkps.pool.sks-keyservers.net',
  options => 'http-proxy="http://proxyuser:proxypass@example.org:3128"',
}
```

#### Parameters

The following parameters are available in the `apt::key` defined type.

##### `id`

Data type: `Pattern[/\A(0x)?[0-9a-fA-F]{8}\Z/, /\A(0x)?[0-9a-fA-F]{16}\Z/, /\A(0x)?[0-9a-fA-F]{40}\Z/]`

Specifies a GPG key to authenticate Apt package signatures. Valid options: a string containing a key ID (8 or 16 hexadecimal
characters, optionally prefixed with "0x") or a full key fingerprint (40 hexadecimal characters).

Default value: $title

##### `ensure`

Data type: `Enum['present', 'absent', 'refreshed']`

Specifies whether the key should exist. Valid options: 'present', 'absent' or 'refreshed'. Using 'refreshed' will make keys auto
update when they have expired (assuming a new key exists on the key server).

Default value: present

##### `content`

Data type: `Optional[String]`

Supplies the entire GPG key. Useful in case the key can't be fetched from a remote location and using a file resource is inconvenient.

Default value: `undef`

##### `source`

Data type: `Optional[Pattern[/\Ahttps?:\/\//, /\Aftp:\/\//, /\A\/\w+/]]`

Specifies the location of an existing GPG key file to copy. Valid options: a string containing a URL (ftp://, http://, or https://) or
an absolute path.

Default value: `undef`

##### `server`

Data type: `Pattern[/\A((hkp|http|https):\/\/)?([a-z\d])([a-z\d-]{0,61}\.)+[a-z\d]+(:\d{2,5})?$/]`

Specifies a keyserver to provide the GPG key. Valid options: a string containing a domain name or a full URL (http://, https://, or
hkp://).

Default value: $::apt::keyserver

##### `options`

Data type: `Optional[String]`

Passes additional options to `apt-key adv --keyserver-options`.

Default value: `undef`

### apt::pin

Manages Apt pins. Does not trigger an apt-get update run.

* **See also**
http://linux.die.net/man/5/apt_preferences
for context on these parameters

#### Parameters

The following parameters are available in the `apt::pin` defined type.

##### `ensure`

Data type: `Optional[Enum['file', 'present', 'absent']]`

Specifies whether the pin should exist. Valid options: 'file', 'present', and 'absent'.

Default value: present

##### `explanation`

Data type: `Optional[String]`

Supplies a comment to explain the pin. Default: "${caller_module_name}: ${name}".

Default value: `undef`

##### `order`

Data type: `Variant[Integer]`

Determines the order in which Apt processes the pin file. Files with lower order numbers are loaded first.

Default value: 50

##### `packages`

Data type: `Variant[String, Array]`

Specifies which package(s) to pin.

Default value: '*'

##### `priority`

Data type: `Variant[Numeric, String]`

Sets the priority of the package. If multiple versions of a given package are available, `apt-get` installs the one with the highest
priority number (subject to dependency constraints). Valid options: an integer.

Default value: 0

##### `release`

Data type: `Optional[String]`

Tells APT to prefer packages that support the specified release. Typical values include 'stable', 'testing', and 'unstable'.

Default value: ''

##### `release_version`

Data type: `Optional[String]`

Tells APT to prefer packages that support the specified operating system release version (such as Debian release version 7).

Default value: ''

##### `component`

Data type: `Optional[String]`

Names the licensing component associated with the packages in the directory tree of the Release file.

Default value: ''

##### `originator`

Data type: `Optional[String]`

Names the originator of the packages in the directory tree of the Release file.

Default value: ''

##### `label`

Data type: `Optional[String]`

Names the label of the packages in the directory tree of the Release file.

Default value: ''

##### `origin`

Data type: `Optional[String]`



Default value: ''

##### `version`

Data type: `Optional[String]`



Default value: ''

##### `codename`

Data type: `Optional[String]`



Default value: ''

### apt::ppa

Manages PPA repositories using `add-apt-repository`. Not supported on Debian.

#### Examples

##### Example declaration of an Apt PPA

```puppet
apt::ppa{ 'ppa:openstack-ppa/bleeding-edge': }
```

#### Parameters

The following parameters are available in the `apt::ppa` defined type.

##### `ensure`

Data type: `String`

Specifies whether the PPA should exist. Valid options: 'present' and 'absent'.

Default value: 'present'

##### `options`

Data type: `Optional[String]`

Supplies options to be passed to the `add-apt-repository` command. Default: '-y'.

Default value: $::apt::ppa_options

##### `release`

Data type: `Optional[String]`

Optional if lsb-release is installed (unless you're using a different release than indicated by lsb-release, e.g., Linux Mint).
Specifies the operating system of your node. Valid options: a string containing a valid LSB distribution codename.

Default value: $facts['lsbdistcodename']

##### `package_name`

Data type: `Optional[String]`

Names the package that provides the `apt-add-repository` command. Default: 'software-properties-common'.

Default value: $::apt::ppa_package

##### `package_manage`

Data type: `Boolean`

Specifies whether Puppet should manage the package that provides `apt-add-repository`.

Default value: `false`

### apt::setting

Manages Apt configuration files.

* **See also**
https://docs.puppetlabs.com/references/latest/type.html#file-attributes
for more information on source and content parameters

#### Parameters

The following parameters are available in the `apt::setting` defined type.

##### `priority`

Data type: `Variant[String, Integer, Array]`

Determines the order in which Apt processes the configuration file. Files with higher priority numbers are loaded first.

Default value: 50

##### `ensure`

Data type: `Optional[Enum['file', 'present', 'absent']]`

Specifies whether the file should exist. Valid options: 'present', 'absent', and 'file'.

Default value: file

##### `source`

Data type: `Optional[String]`

Required, unless `content` is set. Specifies a source file to supply the content of the configuration file. Cannot be used in combination
with `content`. Valid options: see link above for Puppet's native file type source attribute.

Default value: `undef`

##### `content`

Data type: `Optional[String]`

Required, unless `source` is set. Directly supplies content for the configuration file. Cannot be used in combination with `source`. Valid
options: see link above for Puppet's native file type content attribute.

Default value: `undef`

##### `notify_update`

Data type: `Boolean`

Specifies whether to trigger an `apt-get update` run.

Default value: `true`

### apt::source

Manages the Apt sources in /etc/apt/sources.list.d/.

#### Examples

##### Install the puppetlabs apt source

```puppet
apt::source { 'puppetlabs':
  location => 'http://apt.puppetlabs.com',
  repos    => 'main',
  key      => {
    id     => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
    server => 'hkps.pool.sks-keyservers.net',
  },
}
```

#### Parameters

The following parameters are available in the `apt::source` defined type.

##### `location`

Data type: `Optional[String]`

Required, unless ensure is set to 'absent'. Specifies an Apt repository. Valid options: a string containing a repository URL.

Default value: `undef`

##### `comment`

Data type: `String`

Supplies a comment for adding to the Apt source file.

Default value: $name

##### `ensure`

Data type: `String`

Specifies whether the Apt source file should exist. Valid options: 'present' and 'absent'.

Default value: present

##### `release`

Data type: `Optional[String]`

Specifies a distribution of the Apt repository.

Default value: `undef`

##### `repos`

Data type: `String`

Specifies a component of the Apt repository.

Default value: 'main'

##### `include`

Data type: `Optional[Variant[Hash]]`

Configures include options. Valid options: a hash of available keys.

Options:

* **:deb** `Boolean`: Specifies whether to request the distribution's compiled binaries. Default true.
* **:src** `Boolean`: Specifies whether to request the distribution's uncompiled source code. Default false.

Default value: {}

##### `key`

Data type: `Optional[Variant[String, Hash]]`

Creates a declaration of the apt::key defined type. Valid options: a string to be passed to the `id` parameter of the `apt::key`
defined type, or a hash of `parameter => value` pairs to be passed to `apt::key`'s `id`, `server`, `content`, `source`, and/or
`options` parameters.

Default value: `undef`

##### `pin`

Data type: `Optional[Variant[Hash, Numeric, String]]`

Creates a declaration of the apt::pin defined type. Valid options: a number or string to be passed to the `id` parameter of the
`apt::pin` defined type, or a hash of `parameter => value` pairs to be passed to `apt::pin`'s corresponding parameters.

Default value: `undef`

##### `architecture`

Data type: `Optional[String]`

Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
separated by commas (e.g., 'i386' or 'i386,alpha,powerpc'). Default: undef (if unspecified, Apt downloads information for all architectures
defined in the Apt::Architectures option).

Default value: `undef`

##### `allow_unsigned`

Data type: `Boolean`

Specifies whether to authenticate packages from this release, even if the Release file is not signed or the signature can't be checked.

Default value: `false`

##### `notify_update`

Data type: `Boolean`

Specifies whether to trigger an `apt-get update` run.

Default value: `true`

## Resource types

## Tasks

### init

Allows you to perform apt functions

**Supports noop?** false

#### Parameters

##### `action`

Data type: `Enum[update, upgrade]`

Action to perform