(FM-7318) - Added Puppet Strings formatting to documentation
[puppet-modules/puppetlabs-apt.git] / REFERENCE.md
1 # Reference
2 <!-- DO NOT EDIT: This document was generated by Puppet Strings -->
3
4 ## Table of Contents
5
6 **Classes**
7
8 _Public Classes_
9
10 * [`apt`](#apt): Main class, includes all other classes.
11 * [`apt::backports`](#aptbackports): Manages backports.
12
13 _Private Classes_
14
15 * `apt::params`: Provides defaults for the Apt module parameters.
16 * `apt::update`: Updates the list of available packages using apt-get update.
17
18 **Defined types**
19
20 * [`apt::conf`](#aptconf): Specifies a custom Apt configuration file.
21 * [`apt::key`](#aptkey): Manages the GPG keys that Apt uses to authenticate packages.
22 * [`apt::pin`](#aptpin): Manages Apt pins. Does not trigger an apt-get update run.
23 * [`apt::ppa`](#aptppa): Manages PPA repositories using `add-apt-repository`. Not supported on Debian.
24 * [`apt::setting`](#aptsetting): Manages Apt configuration files.
25 * [`apt::source`](#aptsource): Manages the Apt sources in /etc/apt/sources.list.d/.
26
27 **Resource types**
28
29 _Public Resource types_
30
31
32 _Private Resource types_
33
34 * `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 
35
36 **Tasks**
37
38 * [`init`](#init): Allows you to perform apt functions
39
40 ## Classes
41
42 ### apt
43
44 Main class, includes all other classes.
45
46 * **See also**
47 https://docs.puppetlabs.com/references/latest/function.html#createresources
48 for the create resource function
49
50 #### Parameters
51
52 The following parameters are available in the `apt` class.
53
54 ##### `provider`
55
56 Data type: `String`
57
58 Specifies the provider that should be used by apt::update.
59
60 Default value: $apt::params::provider
61
62 ##### `keyserver`
63
64 Data type: `String`
65
66 Specifies a keyserver to provide the GPG key. Valid options: a string containing a domain name or a full URL (http://, https://, or
67 hkp://).
68
69 Default value: $apt::params::keyserver
70
71 ##### `ppa_options`
72
73 Data type: `Optional[String]`
74
75 Supplies options to be passed to the `add-apt-repository` command.
76
77 Default value: $apt::params::ppa_options
78
79 ##### `ppa_package`
80
81 Data type: `Optional[String]`
82
83 Names the package that provides the `apt-add-repository` command.
84
85 Default value: $apt::params::ppa_package
86
87 ##### `backports`
88
89 Data type: `Optional[Hash]`
90
91 Specifies some of the default parameters used by apt::backports. Valid options: a hash made up from the following keys:
92
93 Options:
94
95 * **:location** `String`: See apt::backports for documentation.
96 * **:repos** `String`: See apt::backports for documentation.
97 * **:key** `String`: See apt::backports for documentation.
98
99 Default value: $apt::params::backports
100
101 ##### `confs`
102
103 Data type: `Hash`
104
105 Creates new `apt::conf` resources. Valid options: a hash to be passed to the create_resources function linked above.
106
107 Default value: $apt::params::confs
108
109 ##### `update`
110
111 Data type: `Hash`
112
113 Configures various update settings. Valid options: a hash made up from the following keys:
114
115 Options:
116
117 * **: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.
118 Valid options: 'always' (at every Puppet run); 'daily' (if the value of `apt_update_last_success` is less than current epoch time minus 86400);
119 'weekly' (if the value of `apt_update_last_success` is less than current epoch time minus 604800); and 'reluctantly' (only if the exec resource
120 `apt_update` is notified). Default: 'reluctantly'.
121 * **:loglevel** `Integer`: Specifies the log level of logs outputted to the console. Default: undef.
122 * **:timeout** `Integer`: Specifies how long to wait for the update to complete before canceling it. Valid options: an integer, in seconds. Default: undef.
123 * **:tries** `Integer`: Specifies how many times to retry the update after receiving a DNS or HTTP error. Default: undef.
124
125 Default value: $apt::params::update
126
127 ##### `purge`
128
129 Data type: `Hash`
130
131 Specifies whether to purge any existing settings that aren't managed by Puppet. Valid options: a hash made up from the following keys:
132
133 Options:
134
135 * **:sources.list** `Boolean`: Specifies whether to purge any unmanaged entries from sources.list. Default false.
136 * **:sources.list.d** `Boolean`: Specifies whether to purge any unmanaged entries from sources.list.d. Default false.
137 * **:preferences** `Boolean`: Specifies whether to purge any unmanaged entries from preferences. Default false.
138 * **:preferences.d.** `Boolean`: Specifies whether to purge any unmanaged entries from preferences.d. Default false.
139
140 Default value: $apt::params::purge
141
142 ##### `proxy`
143
144 Data type: `Apt::Proxy`
145
146 Configures Apt to connect to a proxy server. Valid options: a hash matching the locally defined type apt::proxy.
147
148 Default value: $apt::params::proxy
149
150 ##### `sources`
151
152 Data type: `Hash`
153
154 Creates new `apt::source` resources. Valid options: a hash to be passed to the create_resources function linked above.
155
156 Default value: $apt::params::sources
157
158 ##### `keys`
159
160 Data type: `Hash`
161
162 Creates new `apt::key` resources. Valid options: a hash to be passed to the create_resources function linked above.
163
164 Default value: $apt::params::keys
165
166 ##### `ppas`
167
168 Data type: `Hash`
169
170 Creates new `apt::ppa` resources. Valid options: a hash to be passed to the create_resources function linked above.
171
172 Default value: $apt::params::ppas
173
174 ##### `pins`
175
176 Data type: `Hash`
177
178 Creates new `apt::pin` resources. Valid options: a hash to be passed to the create_resources function linked above.
179
180 Default value: $apt::params::pins
181
182 ##### `settings`
183
184 Data type: `Hash`
185
186 Creates new `apt::setting` resources. Valid options: a hash to be passed to the create_resources function linked above.
187
188 Default value: $apt::params::settings
189
190 ##### `auth_conf_entries`
191
192 Data type: `Array[Apt::Auth_conf_entry]`
193
194 An optional array of login configuration settings (hashes) that are recorded in the file /etc/apt/auth.conf. This file has a netrc-like
195 format (similar to what curl uses) and contains the login configuration for APT sources and proxies that require authentication. See
196 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
197 password and no others.
198
199 Default value: $apt::params::auth_conf_entries
200
201 ##### `root`
202
203 Data type: `String`
204
205 Specifies root directory of Apt executable.
206
207 Default value: $apt::params::root
208
209 ##### `sources_list`
210
211 Data type: `String`
212
213 Specifies the path of the sources_list file to use.
214
215 Default value: $apt::params::sources_list
216
217 ##### `sources_list_d`
218
219 Data type: `String`
220
221 Specifies the path of the sources_list.d file to use.
222
223 Default value: $apt::params::sources_list_d
224
225 ##### `conf_d`
226
227 Data type: `String`
228
229 Specifies the path of the conf.d file to use.
230
231 Default value: $apt::params::conf_d
232
233 ##### `preferences`
234
235 Data type: `String`
236
237 Specifies the path of the preferences file to use.
238
239 Default value: $apt::params::preferences
240
241 ##### `preferences_d`
242
243 Data type: `String`
244
245 Specifies the path of the preferences.d file to use.
246
247 Default value: $apt::params::preferences_d
248
249 ##### `config_files`
250
251 Data type: `Hash`
252
253 A hash made up of the various configuration files used by Apt.
254
255 Default value: $apt::params::config_files
256
257 ##### `update_defaults`
258
259 Data type: `Hash`
260
261
262
263 Default value: $apt::params::update_defaults
264
265 ##### `purge_defaults`
266
267 Data type: `Hash`
268
269
270
271 Default value: $apt::params::purge_defaults
272
273 ##### `proxy_defaults`
274
275 Data type: `Hash`
276
277
278
279 Default value: $apt::params::proxy_defaults
280
281 ##### `include_defaults`
282
283 Data type: `Hash`
284
285
286
287 Default value: $apt::params::include_defaults
288
289 ##### `source_key_defaults`
290
291 Data type: `Hash`
292
293
294
295 Default value: $apt::params::source_key_defaults
296
297 ### apt::backports
298
299 Manages backports.
300
301 #### Examples
302
303 ##### Set up a backport for linuxmint qiana
304
305 ```puppet
306 apt::backports { 'qiana':
307   location => 'http://us.archive.ubuntu.com/ubuntu',
308   release  => 'trusty-backports',
309   repos    => 'main universe multiverse restricted',
310   key      => {
311     id     => '630239CC130E1A7FD81A27B140976EAF437D05B5',
312     server => 'hkps.pool.sks-keyservers.net',
313   },
314 }
315 ```
316
317 #### Parameters
318
319 The following parameters are available in the `apt::backports` class.
320
321 ##### `location`
322
323 Data type: `Optional[String]`
324
325 Specifies an Apt repository containing the backports to manage. Valid options: a string containing a URL. Default value for Debian and
326 Ubuntu varies:
327
328 - Debian: 'http://deb.debian.org/debian'
329
330 - Ubuntu: 'http://archive.ubuntu.com/ubuntu'
331
332 Default value: `undef`
333
334 ##### `release`
335
336 Data type: `Optional[String]`
337
338 Specifies a distribution of the Apt repository containing the backports to manage. Used in populating the `source.list` configuration file.
339 Default: on Debian and Ubuntu, '${lsbdistcodename}-backports'. We recommend keeping this default, except on other operating
340 systems.
341
342 Default value: `undef`
343
344 ##### `repos`
345
346 Data type: `Optional[String]`
347
348 Specifies a component of the Apt repository containing the backports to manage. Used in populating the `source.list` configuration file.
349 Default value for Debian and Ubuntu varies:
350
351 - Debian: 'main contrib non-free'
352
353 - Ubuntu: 'main universe multiverse restricted'
354
355 Default value: `undef`
356
357 ##### `key`
358
359 Data type: `Optional[Variant[String, Hash]]`
360
361 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
362 hash of parameter => value pairs to be passed to apt::key's id, server, content, source, and/or options parameters. Default value
363 for Debian and Ubuntu varies:
364
365 - Debian: 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553'
366
367 - Ubuntu: '630239CC130E1A7FD81A27B140976EAF437D05B5'
368
369 Default value: `undef`
370
371 ##### `pin`
372
373 Data type: `Optional[Variant[Integer, String, Hash]]`
374
375 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
376 type, or a hash of `parameter => value` pairs to be passed to `apt::pin`'s corresponding parameters.
377
378 Default value: 200
379
380 ## Defined types
381
382 ### apt::conf
383
384 Specifies a custom Apt configuration file.
385
386 #### Parameters
387
388 The following parameters are available in the `apt::conf` defined type.
389
390 ##### `content`
391
392 Data type: `Optional[String]`
393
394 Required unless `ensure` is set to 'absent'. Directly supplies content for the configuration file.
395
396 Default value: `undef`
397
398 ##### `ensure`
399
400 Data type: `Enum['present', 'absent']`
401
402 Specifies whether the configuration file should exist. Valid options: 'present' and 'absent'.
403
404 Default value: present
405
406 ##### `priority`
407
408 Data type: `Variant[String, Integer]`
409
410 Determines the order in which Apt processes the configuration file. Files with lower priority numbers are loaded first.
411 Valid options: a string containing an integer or an integer.
412
413 Default value: 50
414
415 ##### `notify_update`
416
417 Data type: `Optional[Boolean]`
418
419 Specifies whether to trigger an `apt-get update` run.
420
421 Default value: `undef`
422
423 ### apt::key
424
425 Manages the GPG keys that Apt uses to authenticate packages.
426
427 * **Note** The apt::key defined type makes use of the apt_key type, but includes extra functionality to help prevent duplicate keys.
428
429 #### Examples
430
431 ##### Declare Apt key for apt.puppetlabs.com source
432
433 ```puppet
434 apt::key { 'puppetlabs':
435   id      => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
436   server  => 'hkps.pool.sks-keyservers.net',
437   options => 'http-proxy="http://proxyuser:proxypass@example.org:3128"',
438 }
439 ```
440
441 #### Parameters
442
443 The following parameters are available in the `apt::key` defined type.
444
445 ##### `id`
446
447 Data type: `String`
448
449 Specifies a GPG key to authenticate Apt package signatures. Valid options: a string containing a key ID (8 or 16 hexadecimal
450 characters, optionally prefixed with "0x") or a full key fingerprint (40 hexadecimal characters).
451
452 Default value: $title
453
454 ##### `ensure`
455
456 Data type: `Enum['present', 'absent']`
457
458 Specifies whether the key should exist. Valid options: 'present' and 'absent'.
459
460 Default value: present
461
462 ##### `content`
463
464 Data type: `Optional[String]`
465
466 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.
467
468 Default value: `undef`
469
470 ##### `source`
471
472 Data type: `Optional[String]`
473
474 Specifies the location of an existing GPG key file to copy. Valid options: a string containing a URL (ftp://, http://, or https://) or
475 an absolute path.
476
477 Default value: `undef`
478
479 ##### `server`
480
481 Data type: `String`
482
483 Specifies a keyserver to provide the GPG key. Valid options: a string containing a domain name or a full URL (http://, https://, or
484 hkp://).
485
486 Default value: $::apt::keyserver
487
488 ##### `options`
489
490 Data type: `Optional[String]`
491
492 Passes additional options to `apt-key adv --keyserver-options`.
493
494 Default value: `undef`
495
496 ### apt::pin
497
498 Manages Apt pins. Does not trigger an apt-get update run.
499
500 * **See also**
501 http://linux.die.net/man/5/apt_preferences
502 for context on these parameters
503
504 #### Parameters
505
506 The following parameters are available in the `apt::pin` defined type.
507
508 ##### `ensure`
509
510 Data type: `Optional[Enum['file', 'present', 'absent']]`
511
512 Specifies whether the pin should exist. Valid options: 'file', 'present', and 'absent'.
513
514 Default value: present
515
516 ##### `explanation`
517
518 Data type: `Optional[String]`
519
520 Supplies a comment to explain the pin. Default: "${caller_module_name}: ${name}".
521
522 Default value: `undef`
523
524 ##### `order`
525
526 Data type: `Variant[Integer]`
527
528 Determines the order in which Apt processes the pin file. Files with lower order numbers are loaded first.
529
530 Default value: 50
531
532 ##### `packages`
533
534 Data type: `Variant[String, Array]`
535
536 Specifies which package(s) to pin.
537
538 Default value: '*'
539
540 ##### `priority`
541
542 Data type: `Variant[Numeric, String]`
543
544 Sets the priority of the package. If multiple versions of a given package are available, `apt-get` installs the one with the highest
545 priority number (subject to dependency constraints). Valid options: an integer.
546
547 Default value: 0
548
549 ##### `release`
550
551 Data type: `Optional[String]`
552
553 Tells APT to prefer packages that support the specified release. Typical values include 'stable', 'testing', and 'unstable'.
554
555 Default value: ''
556
557 ##### `release_version`
558
559 Data type: `Optional[String]`
560
561 Tells APT to prefer packages that support the specified operating system release version (such as Debian release version 7).
562
563 Default value: ''
564
565 ##### `component`
566
567 Data type: `Optional[String]`
568
569 Names the licensing component associated with the packages in the directory tree of the Release file.
570
571 Default value: ''
572
573 ##### `originator`
574
575 Data type: `Optional[String]`
576
577 Names the originator of the packages in the directory tree of the Release file.
578
579 Default value: ''
580
581 ##### `label`
582
583 Data type: `Optional[String]`
584
585 Names the label of the packages in the directory tree of the Release file.
586
587 Default value: ''
588
589 ##### `origin`
590
591 Data type: `Optional[String]`
592
593
594
595 Default value: ''
596
597 ##### `version`
598
599 Data type: `Optional[String]`
600
601
602
603 Default value: ''
604
605 ##### `codename`
606
607 Data type: `Optional[String]`
608
609
610
611 Default value: ''
612
613 ### apt::ppa
614
615 Manages PPA repositories using `add-apt-repository`. Not supported on Debian.
616
617 #### Examples
618
619 ##### Example declaration of an Apt PPA
620
621 ```puppet
622 apt::ppa{ 'ppa:openstack-ppa/bleeding-edge': }
623 ```
624
625 #### Parameters
626
627 The following parameters are available in the `apt::ppa` defined type.
628
629 ##### `ensure`
630
631 Data type: `String`
632
633 Specifies whether the PPA should exist. Valid options: 'present' and 'absent'.
634
635 Default value: 'present'
636
637 ##### `options`
638
639 Data type: `Optional[String]`
640
641 Supplies options to be passed to the `add-apt-repository` command. Default: '-y'.
642
643 Default value: $::apt::ppa_options
644
645 ##### `release`
646
647 Data type: `Optional[String]`
648
649 Optional if lsb-release is installed (unless you're using a different release than indicated by lsb-release, e.g., Linux Mint).
650 Specifies the operating system of your node. Valid options: a string containing a valid LSB distribution codename.
651
652 Default value: $facts['lsbdistcodename']
653
654 ##### `package_name`
655
656 Data type: `Optional[String]`
657
658 Names the package that provides the `apt-add-repository` command. Default: 'software-properties-common'.
659
660 Default value: $::apt::ppa_package
661
662 ##### `package_manage`
663
664 Data type: `Boolean`
665
666 Specifies whether Puppet should manage the package that provides `apt-add-repository`.
667
668 Default value: `false`
669
670 ### apt::setting
671
672 Manages Apt configuration files.
673
674 * **See also**
675 https://docs.puppetlabs.com/references/latest/type.html#file-attributes
676 for more information on source and content parameters
677
678 #### Parameters
679
680 The following parameters are available in the `apt::setting` defined type.
681
682 ##### `priority`
683
684 Data type: `Variant[String, Integer, Array]`
685
686 Determines the order in which Apt processes the configuration file. Files with higher priority numbers are loaded first.
687
688 Default value: 50
689
690 ##### `ensure`
691
692 Data type: `Optional[Enum['file', 'present', 'absent']]`
693
694 Specifies whether the file should exist. Valid options: 'present', 'absent', and 'file'.
695
696 Default value: file
697
698 ##### `source`
699
700 Data type: `Optional[String]`
701
702 Required, unless `content` is set. Specifies a source file to supply the content of the configuration file. Cannot be used in combination
703 with `content`. Valid options: see link above for Puppet's native file type source attribute.
704
705 Default value: `undef`
706
707 ##### `content`
708
709 Data type: `Optional[String]`
710
711 Required, unless `source` is set. Directly supplies content for the configuration file. Cannot be used in combination with `source`. Valid
712 options: see link above for Puppet's native file type content attribute.
713
714 Default value: `undef`
715
716 ##### `notify_update`
717
718 Data type: `Boolean`
719
720 Specifies whether to trigger an `apt-get update` run.
721
722 Default value: `true`
723
724 ### apt::source
725
726 Manages the Apt sources in /etc/apt/sources.list.d/.
727
728 #### Examples
729
730 ##### Install the puppetlabs apt source
731
732 ```puppet
733 apt::source { 'puppetlabs':
734   location => 'http://apt.puppetlabs.com',
735   repos    => 'main',
736   key      => {
737     id     => '6F6B15509CF8E59E6E469F327F438280EF8D349F',
738     server => 'hkps.pool.sks-keyservers.net',
739   },
740 }
741 ```
742
743 #### Parameters
744
745 The following parameters are available in the `apt::source` defined type.
746
747 ##### `location`
748
749 Data type: `Optional[String]`
750
751 Required, unless ensure is set to 'absent'. Specifies an Apt repository. Valid options: a string containing a repository URL.
752
753 Default value: `undef`
754
755 ##### `comment`
756
757 Data type: `String`
758
759 Supplies a comment for adding to the Apt source file.
760
761 Default value: $name
762
763 ##### `ensure`
764
765 Data type: `String`
766
767 Specifies whether the Apt source file should exist. Valid options: 'present' and 'absent'.
768
769 Default value: present
770
771 ##### `release`
772
773 Data type: `Optional[String]`
774
775 Specifies a distribution of the Apt repository.
776
777 Default value: `undef`
778
779 ##### `repos`
780
781 Data type: `String`
782
783 Specifies a component of the Apt repository.
784
785 Default value: 'main'
786
787 ##### `include`
788
789 Data type: `Optional[Variant[Hash]]`
790
791 Configures include options. Valid options: a hash of available keys.
792
793 Options:
794
795 * **:deb** `Boolean`: Specifies whether to request the distribution's compiled binaries. Default true.
796 * **:src** `Boolean`: Specifies whether to request the distribution's uncompiled source code. Default false.
797
798 Default value: {}
799
800 ##### `key`
801
802 Data type: `Optional[Variant[String, Hash]]`
803
804 Creates a declaration of the apt::key defined type. Valid options: a string to be passed to the `id` parameter of the `apt::key`
805 defined type, or a hash of `parameter => value` pairs to be passed to `apt::key`'s `id`, `server`, `content`, `source`, and/or
806 `options` parameters.
807
808 Default value: `undef`
809
810 ##### `pin`
811
812 Data type: `Optional[Variant[Hash, Numeric, String]]`
813
814 Creates a declaration of the apt::pin defined type. Valid options: a number or string to be passed to the `id` parameter of the
815 `apt::pin` defined type, or a hash of `parameter => value` pairs to be passed to `apt::pin`'s corresponding parameters.
816
817 Default value: `undef`
818
819 ##### `architecture`
820
821 Data type: `Optional[String]`
822
823 Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
824 separated by commas (e.g., 'i386' or 'i386,alpha,powerpc'). Default: undef (if unspecified, Apt downloads information for all architectures
825 defined in the Apt::Architectures option).
826
827 Default value: `undef`
828
829 ##### `allow_unsigned`
830
831 Data type: `Boolean`
832
833 Specifies whether to authenticate packages from this release, even if the Release file is not signed or the signature can't be checked.
834
835 Default value: `false`
836
837 ##### `notify_update`
838
839 Data type: `Boolean`
840
841 Specifies whether to trigger an `apt-get update` run.
842
843 Default value: `true`
844
845 ## Resource types
846
847 ## Tasks
848
849 ### init
850
851 Allows you to perform apt functions
852
853 **Supports noop?** false
854
855 #### Parameters
856
857 ##### `action`
858
859 Data type: `Enum[update, upgrade]`
860
861 Action to perform 
862