Skip to content

Commit 094bfdb

Browse files
committed
keyring: remove the file param
Being able to provide the dir, filename, and full file path makes the logic too complicated for users of this defined type. We should only allow providing the filename and dir, and then compute the full path from those. Otherwise, someone could pass all three parameters, in which case the filename and dir would be ignored, which could be confusing.
1 parent 2c72290 commit 094bfdb

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

REFERENCE.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,6 @@ The following parameters are available in the `apt::keyring` defined type:
662662

663663
* [`dir`](#-apt--keyring--dir)
664664
* [`filename`](#-apt--keyring--filename)
665-
* [`file`](#-apt--keyring--file)
666665
* [`mode`](#-apt--keyring--mode)
667666
* [`source`](#-apt--keyring--source)
668667
* [`content`](#-apt--keyring--content)
@@ -684,14 +683,6 @@ Optional filename for the keyring. It should also contain extension along with t
684683

685684
Default value: `$name`
686685

687-
##### <a name="-apt--keyring--file"></a>`file`
688-
689-
Data type: `Stdlib::Absolutepath`
690-
691-
File path of the keyring.
692-
693-
Default value: `"${dir}/${filename}"`
694-
695686
##### <a name="-apt--keyring--mode"></a>`mode`
696687

697688
Data type: `Stdlib::Filemode`

manifests/keyring.pp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
# @param filename
2121
# Optional filename for the keyring. It should also contain extension along with the filename.
2222
#
23-
# @param file
24-
# File path of the keyring.
25-
#
2623
# @param mode
2724
# File permissions of the keyring.
2825
#
@@ -38,7 +35,6 @@
3835
define apt::keyring (
3936
Stdlib::Absolutepath $dir = '/etc/apt/keyrings',
4037
String[1] $filename = $name,
41-
Stdlib::Absolutepath $file = "${dir}/${filename}",
4238
Stdlib::Filemode $mode = '0644',
4339
Optional[Stdlib::Filesource] $source = undef,
4440
Optional[String[1]] $content = undef,
@@ -51,6 +47,8 @@
5147
fail("One of 'source' or 'content' parameters are required")
5248
}
5349

50+
$file = "${dir}/${filename}"
51+
5452
case $ensure {
5553
'present': {
5654
file { $file:

0 commit comments

Comments
 (0)