2020
2121* [ ` apt::conf ` ] ( #apt--conf ) : Specifies a custom Apt configuration file.
2222* [ ` apt::key ` ] ( #apt--key ) : Manages the GPG keys that Apt uses to authenticate packages.
23+ * [ ` apt::keyring ` ] ( #apt--keyring ) : Manage GPG keyrings for apt repositories
2324* [ ` apt::mark ` ] ( #apt--mark ) : Manages apt-mark settings
2425* [ ` apt::pin ` ] ( #apt--pin ) : Manages Apt pins. Does not trigger an apt-get update run.
2526* [ ` apt::ppa ` ] ( #apt--ppa ) : Manages PPA repositories using ` add-apt-repository ` . Not supported on Debian.
@@ -73,6 +74,7 @@ The following parameters are available in the `apt` class:
7374* [ ` proxy_defaults ` ] ( #-apt--proxy_defaults )
7475* [ ` sources ` ] ( #-apt--sources )
7576* [ ` keys ` ] ( #-apt--keys )
77+ * [ ` keyrings ` ] ( #-apt--keyrings )
7678* [ ` ppas ` ] ( #-apt--ppas )
7779* [ ` pins ` ] ( #-apt--pins )
7880* [ ` settings ` ] ( #-apt--settings )
@@ -239,6 +241,14 @@ Creates new `apt::key` resources. Valid options: a hash to be passed to the crea
239241
240242Default value: ` $apt::params::keys `
241243
244+ ##### <a name =" -apt--keyrings " ></a >` keyrings `
245+
246+ Data type: ` Hash `
247+
248+ Hash of ` apt::keyring ` resources.
249+
250+ Default value: ` {} `
251+
242252##### <a name =" -apt--ppas " ></a >` ppas `
243253
244254Data type: ` Hash `
@@ -624,6 +634,101 @@ Passes additional options to `apt-key adv --keyserver-options`.
624634
625635Default value: ` $apt::key_options `
626636
637+ ### <a name =" apt--keyring " ></a >` apt::keyring `
638+
639+ Manage GPG keyrings for apt repositories
640+
641+ #### Examples
642+
643+ ##### Download the puppetlabs apt keyring
644+
645+ ``` puppet
646+ apt::keyring { 'puppetlabs-keyring.gpg':
647+ source => 'https://apt.puppetlabs.com/keyring.gpg',
648+ }
649+ ```
650+
651+ ##### Deploy the apt source and associated keyring file
652+
653+ ``` puppet
654+ apt::source { 'puppet8-release':
655+ location => 'http://apt.puppetlabs.com',
656+ repos => 'puppet8',
657+ key => {
658+ name => 'puppetlabs-keyring.gpg',
659+ source => 'https://apt.puppetlabs.com/keyring.gpg'
660+ }
661+ }
662+ ```
663+
664+ #### Parameters
665+
666+ The following parameters are available in the ` apt::keyring ` defined type:
667+
668+ * [ ` keyring_dir ` ] ( #-apt--keyring--keyring_dir )
669+ * [ ` keyring_filename ` ] ( #-apt--keyring--keyring_filename )
670+ * [ ` keyring_file ` ] ( #-apt--keyring--keyring_file )
671+ * [ ` keyring_file_mode ` ] ( #-apt--keyring--keyring_file_mode )
672+ * [ ` source ` ] ( #-apt--keyring--source )
673+ * [ ` content ` ] ( #-apt--keyring--content )
674+ * [ ` ensure ` ] ( #-apt--keyring--ensure )
675+
676+ ##### <a name =" -apt--keyring--keyring_dir " ></a >` keyring_dir `
677+
678+ Data type: ` Stdlib::Absolutepath `
679+
680+ Path to the directory where the keyring will be stored.
681+
682+ Default value: ` '/etc/apt/keyrings' `
683+
684+ ##### <a name =" -apt--keyring--keyring_filename " ></a >` keyring_filename `
685+
686+ Data type: ` String[1] `
687+
688+ Optional filename for the keyring. It should also contain extension along with the filename.
689+
690+ Default value: ` $name `
691+
692+ ##### <a name =" -apt--keyring--keyring_file " ></a >` keyring_file `
693+
694+ Data type: ` Stdlib::Absolutepath `
695+
696+ File path of the keyring.
697+
698+ Default value: ` "${keyring_dir}/${keyring_filename}" `
699+
700+ ##### <a name =" -apt--keyring--keyring_file_mode " ></a >` keyring_file_mode `
701+
702+ Data type: ` Stdlib::Filemode `
703+
704+ File permissions of the keyring.
705+
706+ Default value: ` '0644' `
707+
708+ ##### <a name =" -apt--keyring--source " ></a >` source `
709+
710+ Data type: ` Optional[Stdlib::Filesource] `
711+
712+ Source of the keyring file. Mutually exclusive with 'content'.
713+
714+ Default value: ` undef `
715+
716+ ##### <a name =" -apt--keyring--content " ></a >` content `
717+
718+ Data type: ` Optional[String[1]] `
719+
720+ Content of the keyring file. Mutually exclusive with 'source'.
721+
722+ Default value: ` undef `
723+
724+ ##### <a name =" -apt--keyring--ensure " ></a >` ensure `
725+
726+ Data type: ` Enum['present','absent'] `
727+
728+ Ensure presence or absence of the resource.
729+
730+ Default value: ` 'present' `
731+
627732### <a name =" apt--mark " ></a >` apt::mark `
628733
629734Manages apt-mark settings
@@ -925,6 +1030,20 @@ apt::source { 'puppetlabs':
9251030}
9261031```
9271032
1033+ ##### Download key behaviour to handle modern apt gpg keyrings. The ` name ` parameter in the key hash should be given with
1034+
1035+ ``` puppet
1036+ extension. Absence of extension will result in file formation with just name and no extension.
1037+ apt::source { 'puppetlabs':
1038+ location => 'http://apt.puppetlabs.com',
1039+ comment => 'Puppet8',
1040+ key => {
1041+ 'name' => 'puppetlabs.gpg',
1042+ 'source' => 'https://apt.puppetlabs.com/keyring.gpg',
1043+ },
1044+ }
1045+ ```
1046+
9281047#### Parameters
9291048
9301049The following parameters are available in the ` apt::source ` defined type:
@@ -1001,9 +1120,12 @@ Default value: `{}`
10011120
10021121Data type: ` Optional[Variant[String, Hash]] `
10031122
1004- Creates a declaration of the apt::key defined type. Valid options: a string to be passed to the ` id ` parameter of the ` apt::key `
1005- defined type, or a hash of ` parameter => value ` pairs to be passed to ` apt::key ` 's ` id ` , ` server ` , ` content ` , ` source ` , ` weak_ssl ` ,
1006- and/or ` options ` parameters.
1123+ Creates an ` apt::keyring ` in ` /etc/apt/keyrings ` (or anywhere on disk given ` filename ` ) Valid options:
1124+ * a hash of ` parameter => value ` pairs to be passed to ` file ` : ` name ` (title), ` content ` , ` source ` , ` filename `
1125+
1126+ The following inputs are valid for the (deprecated) ` apt::key ` defined type. Valid options:
1127+ * a string to be passed to the ` id ` parameter of the ` apt::key ` defined type
1128+ * a hash of ` parameter => value ` pairs to be passed to ` apt::key ` : ` id ` , ` server ` , ` content ` , ` source ` , ` weak_ssl ` , ` options `
10071129
10081130Default value: ` undef `
10091131
@@ -1012,6 +1134,7 @@ Default value: `undef`
10121134Data type: ` Optional[Stdlib::AbsolutePath] `
10131135
10141136Absolute path to a file containing the PGP keyring used to sign this repository. Value is used to set signed-by on the source entry.
1137+ This is not necessary if the key is installed with ` key ` param above.
10151138See https://wiki.debian.org/DebianRepository/UseThirdParty for details.
10161139
10171140Default value: ` undef `
@@ -1030,8 +1153,8 @@ Default value: `undef`
10301153Data type: ` Optional[String] `
10311154
10321155Tells Apt to only download information for specified architectures. Valid options: a string containing one or more architecture names,
1033- separated by commas (e.g., 'i386' or 'i386,alpha,powerpc'). Default: undef (if unspecified, Apt downloads information for all architectures
1034- defined in the Apt::Architectures option).
1156+ separated by commas (e.g., 'i386' or 'i386,alpha,powerpc').
1157+ (if unspecified, Apt downloads information for all architectures defined in the Apt::Architectures option)
10351158
10361159Default value: ` undef `
10371160
0 commit comments