Skip to content

Commit fa62402

Browse files
jorhettpraj1001
authored andcommitted
Add apt::keyring defined type which creates modern-style keyrings
1 parent 6ab5dc4 commit fa62402

File tree

6 files changed

+588
-308
lines changed

6 files changed

+588
-308
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ include apt
6565
<a id="add-gpg-keys"></a>
6666

6767
### Add GPG keys
68+
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` or `.asc`)
69+
70+
#### Fetch via HTTP
71+
```puppet
72+
apt::keyring {'puppetlabs-keyring.gpg':
73+
source => 'https://apt.puppetlabs.com/keyring.gpg',
74+
}
75+
```
76+
77+
#### Fetch via Puppet URI
78+
```puppet
79+
apt::keyring {'puppetlabs-keyring.gpg':
80+
source => 'puppet:///modules/my_module/local_puppetlabs-keyring.gpg',
81+
}
82+
```
83+
84+
Alternatively `apt::key` can be used.
85+
86+
**Warning** `apt::key` is deprecated in the latest Debian and Ubuntu releases. Please use apt::keyring instead.
6887

6988
**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.
7089

@@ -184,6 +203,22 @@ apt::source { 'puppetlabs':
184203
}
185204
```
186205

206+
### Adding name and source to the key parameter of apt::source, which then manages modern apt gpg keyrings
207+
208+
The name parameter of key hash should contain name with extensions (such as puppetlabs.gpg), Absence of extension will result in creation of file with just name and no extension.
209+
210+
```puppet
211+
apt::source { 'puppetlabs':
212+
comment => 'Puppet8',
213+
location => 'https://apt.puppetlabs.com/',
214+
repos => 'puppet8',
215+
key => {
216+
'name' => 'puppetlabs.gpg',
217+
'source' => 'https://apt.puppetlabs.com/keyring.gpg',
218+
},
219+
}
220+
```
221+
187222
<a id="configure-apt-from-hiera"></a>
188223

189224
### Configure Apt from Hiera

0 commit comments

Comments
 (0)