Skip to content

Commit 2c72290

Browse files
committed
keyring: rename parameters to remove redundancy
We don't need apt::keyring::keyring_thing, it should just be apt::keyring::thing.
1 parent bee5ee1 commit 2c72290

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

REFERENCE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -660,39 +660,39 @@ apt::source { 'puppet8-release':
660660

661661
The following parameters are available in the `apt::keyring` defined type:
662662

663-
* [`keyring_dir`](#-apt--keyring--keyring_dir)
664-
* [`keyring_filename`](#-apt--keyring--keyring_filename)
665-
* [`keyring_file`](#-apt--keyring--keyring_file)
666-
* [`keyring_file_mode`](#-apt--keyring--keyring_file_mode)
663+
* [`dir`](#-apt--keyring--dir)
664+
* [`filename`](#-apt--keyring--filename)
665+
* [`file`](#-apt--keyring--file)
666+
* [`mode`](#-apt--keyring--mode)
667667
* [`source`](#-apt--keyring--source)
668668
* [`content`](#-apt--keyring--content)
669669
* [`ensure`](#-apt--keyring--ensure)
670670

671-
##### <a name="-apt--keyring--keyring_dir"></a>`keyring_dir`
671+
##### <a name="-apt--keyring--dir"></a>`dir`
672672

673673
Data type: `Stdlib::Absolutepath`
674674

675675
Path to the directory where the keyring will be stored.
676676

677677
Default value: `'/etc/apt/keyrings'`
678678

679-
##### <a name="-apt--keyring--keyring_filename"></a>`keyring_filename`
679+
##### <a name="-apt--keyring--filename"></a>`filename`
680680

681681
Data type: `String[1]`
682682

683683
Optional filename for the keyring. It should also contain extension along with the filename.
684684

685685
Default value: `$name`
686686

687-
##### <a name="-apt--keyring--keyring_file"></a>`keyring_file`
687+
##### <a name="-apt--keyring--file"></a>`file`
688688

689689
Data type: `Stdlib::Absolutepath`
690690

691691
File path of the keyring.
692692

693-
Default value: `"${keyring_dir}/${keyring_filename}"`
693+
Default value: `"${dir}/${filename}"`
694694

695-
##### <a name="-apt--keyring--keyring_file_mode"></a>`keyring_file_mode`
695+
##### <a name="-apt--keyring--mode"></a>`mode`
696696

697697
Data type: `Stdlib::Filemode`
698698

manifests/keyring.pp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
# }
1515
# }
1616
#
17-
# @param keyring_dir
17+
# @param dir
1818
# Path to the directory where the keyring will be stored.
1919
#
20-
# @param keyring_filename
20+
# @param filename
2121
# Optional filename for the keyring. It should also contain extension along with the filename.
2222
#
23-
# @param keyring_file
23+
# @param file
2424
# File path of the keyring.
2525
#
26-
# @param keyring_file_mode
26+
# @param mode
2727
# File permissions of the keyring.
2828
#
2929
# @param source
@@ -36,15 +36,15 @@
3636
# Ensure presence or absence of the resource.
3737
#
3838
define apt::keyring (
39-
Stdlib::Absolutepath $keyring_dir = '/etc/apt/keyrings',
40-
String[1] $keyring_filename = $name,
41-
Stdlib::Absolutepath $keyring_file = "${keyring_dir}/${keyring_filename}",
42-
Stdlib::Filemode $keyring_file_mode = '0644',
39+
Stdlib::Absolutepath $dir = '/etc/apt/keyrings',
40+
String[1] $filename = $name,
41+
Stdlib::Absolutepath $file = "${dir}/${filename}",
42+
Stdlib::Filemode $mode = '0644',
4343
Optional[Stdlib::Filesource] $source = undef,
4444
Optional[String[1]] $content = undef,
4545
Enum['present','absent'] $ensure = 'present',
4646
) {
47-
ensure_resource('file', $keyring_dir, { ensure => 'directory', mode => '0755', })
47+
ensure_resource('file', $dir, { ensure => 'directory', mode => '0755', })
4848
if $source and $content {
4949
fail("Parameters 'source' and 'content' are mutually exclusive")
5050
} elsif ! $source and ! $content {
@@ -53,17 +53,17 @@
5353

5454
case $ensure {
5555
'present': {
56-
file { $keyring_file:
56+
file { $file:
5757
ensure => 'file',
58-
mode => $keyring_file_mode,
58+
mode => $mode,
5959
owner => 'root',
6060
group => 'root',
6161
source => $source,
6262
content => $content,
6363
}
6464
}
6565
'absent': {
66-
file { $keyring_file:
66+
file { $file:
6767
ensure => $ensure,
6868
}
6969
}

manifests/source.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@
183183
# Modern apt keyrings
184184
elsif $_key =~ Hash and $_key['name'] {
185185
apt::keyring { $_key['name']:
186-
ensure => $_key_ensure,
187-
content => $_key['content'],
188-
source => $_key['source'],
189-
keyring_filename => $_key['filename'],
190-
before => $_before,
186+
ensure => $_key_ensure,
187+
content => $_key['content'],
188+
source => $_key['source'],
189+
filename => $_key['filename'],
190+
before => $_before,
191191
}
192192
# TODO replace this block with a reference to the apt::keyring's final filename/full_path
193193
if $_key['filename'] {

0 commit comments

Comments
 (0)