|
14 | 14 | # } |
15 | 15 | # } |
16 | 16 | # |
17 | | -# @param keyring_dir |
| 17 | +# @param dir |
18 | 18 | # Path to the directory where the keyring will be stored. |
19 | 19 | # |
20 | | -# @param keyring_filename |
| 20 | +# @param filename |
21 | 21 | # Optional filename for the keyring. It should also contain extension along with the filename. |
22 | 22 | # |
23 | | -# @param keyring_file |
| 23 | +# @param file |
24 | 24 | # File path of the keyring. |
25 | 25 | # |
26 | | -# @param keyring_file_mode |
| 26 | +# @param mode |
27 | 27 | # File permissions of the keyring. |
28 | 28 | # |
29 | 29 | # @param source |
|
36 | 36 | # Ensure presence or absence of the resource. |
37 | 37 | # |
38 | 38 | 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', |
43 | 43 | Optional[Stdlib::Filesource] $source = undef, |
44 | 44 | Optional[String[1]] $content = undef, |
45 | 45 | Enum['present','absent'] $ensure = 'present', |
46 | 46 | ) { |
47 | | - ensure_resource('file', $keyring_dir, { ensure => 'directory', mode => '0755', }) |
| 47 | + ensure_resource('file', $dir, { ensure => 'directory', mode => '0755', }) |
48 | 48 | if $source and $content { |
49 | 49 | fail("Parameters 'source' and 'content' are mutually exclusive") |
50 | 50 | } elsif ! $source and ! $content { |
|
53 | 53 |
|
54 | 54 | case $ensure { |
55 | 55 | 'present': { |
56 | | - file { $keyring_file: |
| 56 | + file { $file: |
57 | 57 | ensure => 'file', |
58 | | - mode => $keyring_file_mode, |
| 58 | + mode => $mode, |
59 | 59 | owner => 'root', |
60 | 60 | group => 'root', |
61 | 61 | source => $source, |
62 | 62 | content => $content, |
63 | 63 | } |
64 | 64 | } |
65 | 65 | 'absent': { |
66 | | - file { $keyring_file: |
| 66 | + file { $file: |
67 | 67 | ensure => $ensure, |
68 | 68 | } |
69 | 69 | } |
|
0 commit comments