Skip to content

Commit d6c2628

Browse files
authored
Merge pull request #216 from voxpupuli/modulesync
add puppet-lint-param-docs
2 parents cfe7473 + 0cbcea7 commit d6c2628

File tree

12 files changed

+82
-101
lines changed

12 files changed

+82
-101
lines changed

.sync.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
Gemfile:
3+
optional:
4+
':test':
5+
- gem: puppet-lint-param-docs

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ group :test do
88
gem 'coveralls', :require => false
99
gem 'simplecov-console', :require => false
1010
gem 'puppet_metadata', '~> 1.0', :require => false
11+
gem 'puppet-lint-param-docs', :require => false
1112
end
1213

1314
group :development do

REFERENCE.md

Lines changed: 41 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737

3838
### Data types
3939

40-
* [`Systemd::Dropin`](#systemddropin)
40+
* [`Systemd::Dropin`](#systemddropin): custom datatype that validates filenames/paths for valid systemd dropin files
4141
* [`Systemd::JournaldSettings`](#systemdjournaldsettings): Matches Systemd journald config Struct
42-
* [`Systemd::JournaldSettings::Ensure`](#systemdjournaldsettingsensure)
42+
* [`Systemd::JournaldSettings::Ensure`](#systemdjournaldsettingsensure): defines allowed ensure states for systemd-journald settings
4343
* [`Systemd::LogindSettings`](#systemdlogindsettings): Matches Systemd Login Manager Struct
44-
* [`Systemd::LogindSettings::Ensure`](#systemdlogindsettingsensure)
44+
* [`Systemd::LogindSettings::Ensure`](#systemdlogindsettingsensure): defines allowed ensure states for systemd-logind settings
4545
* [`Systemd::ServiceLimits`](#systemdservicelimits): Matches Systemd Service Limit Struct
46-
* [`Systemd::Unit`](#systemdunit)
46+
* [`Systemd::Unit`](#systemdunit): custom datatype that validates different filenames for systemd units
4747

4848
## Classes
4949

@@ -328,19 +328,19 @@ where all networkd files are placed in
328328

329329
Data type: `Boolean`
330330

331-
331+
when enabled, the different accounting options (network traffic, IO, CPU util...) are enabled for units
332332

333333
##### <a name="accounting"></a>`accounting`
334334

335335
Data type: `Hash[String,String]`
336336

337-
337+
Hash of the different accounting options. This highly depends on the used systemd version. The module provides sane defaults.
338338

339339
##### <a name="purge_dropin_dirs"></a>`purge_dropin_dirs`
340340

341341
Data type: `Boolean`
342342

343-
343+
When enabled, unused directories for dropin files will be purged
344344

345345
### <a name="systemdtmpfiles"></a>`systemd::tmpfiles`
346346

@@ -379,7 +379,9 @@ Creates a drop-in file for a systemd unit
379379

380380
The following parameters are available in the `systemd::dropin_file` defined type:
381381

382-
* [`name`](#name)
382+
* [`unit`](#unit)
383+
* [`filename`](#filename)
384+
* [`ensure`](#ensure)
383385
* [`path`](#path)
384386
* [`selinux_ignore_defaults`](#selinux_ignore_defaults)
385387
* [`content`](#content)
@@ -390,16 +392,29 @@ The following parameters are available in the `systemd::dropin_file` defined typ
390392
* [`mode`](#mode)
391393
* [`show_diff`](#show_diff)
392394
* [`notify_service`](#notify_service)
393-
* [`unit`](#unit)
394-
* [`filename`](#filename)
395-
* [`ensure`](#ensure)
396395

397-
##### <a name="name"></a>`name`
396+
##### <a name="unit"></a>`unit`
398397

399-
Data type: `Pattern['^[^/]+\.conf$']`
398+
Data type: `Systemd::Unit`
399+
400+
the The target unit file to create, the value will be set to the `filename` parameter as well
401+
402+
##### <a name="filename"></a>`filename`
403+
404+
Data type: `Systemd::Dropin`
400405

401406
The target unit file to create
402407

408+
Default value: `$name`
409+
410+
##### <a name="ensure"></a>`ensure`
411+
412+
Data type: `Enum['present', 'absent', 'file']`
413+
414+
the state of this dropin file
415+
416+
Default value: `'present'`
417+
403418
##### <a name="path"></a>`path`
404419

405420
Data type: `Stdlib::Absolutepath`
@@ -420,29 +435,23 @@ Default value: ``false``
420435

421436
Data type: `Optional[Variant[String,Sensitive[String]]]`
422437

423-
The full content of the unit file
424-
425-
* Mutually exclusive with ``$source``
438+
The full content of the unit file (Mutually exclusive with `$source`)
426439

427440
Default value: ``undef``
428441

429442
##### <a name="source"></a>`source`
430443

431444
Data type: `Optional[String]`
432445

433-
The ``File`` resource compatible ``source``
434-
435-
* Mutually exclusive with ``$content``
446+
The `File` resource compatible `source` Mutually exclusive with ``$content``
436447

437448
Default value: ``undef``
438449

439450
##### <a name="target"></a>`target`
440451

441452
Data type: `Optional[Stdlib::Absolutepath]`
442453

443-
If set, will force the file to be a symlink to the given target
444-
445-
* Mutually exclusive with both ``$source`` and ``$content``
454+
If set, will force the file to be a symlink to the given target (Mutually exclusive with both `$source` and `$content`
446455

447456
Default value: ``undef``
448457

@@ -486,28 +495,6 @@ Notify a service for the unit, if it exists
486495

487496
Default value: ``false``
488497

489-
##### <a name="unit"></a>`unit`
490-
491-
Data type: `Systemd::Unit`
492-
493-
494-
495-
##### <a name="filename"></a>`filename`
496-
497-
Data type: `Systemd::Dropin`
498-
499-
500-
501-
Default value: `$name`
502-
503-
##### <a name="ensure"></a>`ensure`
504-
505-
Data type: `Enum['present', 'absent', 'file']`
506-
507-
508-
509-
Default value: `'present'`
510-
511498
### <a name="systemdnetwork"></a>`systemd::network`
512499

513500
Creates network config for systemd-networkd
@@ -829,7 +816,7 @@ Default value: ``undef``
829816

830817
Data type: `Enum['present', 'absent', 'file']`
831818

832-
819+
Defines the desired state of the timer
833820

834821
Default value: `'present'`
835822

@@ -844,20 +831,20 @@ Creates a systemd tmpfile
844831

845832
The following parameters are available in the `systemd::tmpfile` defined type:
846833

847-
* [`name`](#name)
834+
* [`filename`](#filename)
848835
* [`ensure`](#ensure)
849836
* [`path`](#path)
850837
* [`content`](#content)
851838
* [`source`](#source)
852-
* [`filename`](#filename)
853839

854-
##### <a name="name"></a>`name`
840+
##### <a name="filename"></a>`filename`
855841

856-
Data type: `Pattern['^[^/]+\.conf$']`
842+
Data type: `Systemd::Dropin`
857843

858-
(filename)
859844
The name of the tmpfile to create
860845

846+
Default value: `$name`
847+
861848
##### <a name="ensure"></a>`ensure`
862849

863850
Data type: `Enum['present', 'absent', 'file']`
@@ -894,14 +881,6 @@ A ``File`` resource compatible ``source``
894881

895882
Default value: ``undef``
896883

897-
##### <a name="filename"></a>`filename`
898-
899-
Data type: `Systemd::Dropin`
900-
901-
902-
903-
Default value: `$name`
904-
905884
### <a name="systemdudevrule"></a>`systemd::udev::rule`
906885

907886
Adds a custom udev rule
@@ -1137,7 +1116,7 @@ usually discover the appropriate provider for your platform.
11371116

11381117
### <a name="systemddropin"></a>`Systemd::Dropin`
11391118

1140-
The Systemd::Dropin data type.
1119+
custom datatype that validates filenames/paths for valid systemd dropin files
11411120

11421121
Alias of
11431122

@@ -1188,7 +1167,7 @@ Struct[{
11881167

11891168
### <a name="systemdjournaldsettingsensure"></a>`Systemd::JournaldSettings::Ensure`
11901169

1191-
The Systemd::JournaldSettings::Ensure data type.
1170+
defines allowed ensure states for systemd-journald settings
11921171

11931172
Alias of
11941173

@@ -1233,7 +1212,7 @@ Struct[{
12331212

12341213
### <a name="systemdlogindsettingsensure"></a>`Systemd::LogindSettings::Ensure`
12351214

1236-
The Systemd::LogindSettings::Ensure data type.
1215+
defines allowed ensure states for systemd-logind settings
12371216

12381217
Alias of
12391218

@@ -1294,7 +1273,7 @@ Struct[{
12941273

12951274
### <a name="systemdunit"></a>`Systemd::Unit`
12961275

1297-
The Systemd::Unit data type.
1276+
custom datatype that validates different filenames for systemd units
12981277

12991278
Alias of
13001279

lib/puppet/provider/loginctl_user/ruby.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
# @summary custom provider to manage systemd user sessions/linger
2+
# @see https://www.freedesktop.org/software/systemd/man/loginctl.html
3+
# @see https://wiki.archlinux.org/title/Systemd/User
14
Puppet::Type.type(:loginctl_user).provide(:ruby) do
5+
desc 'custom provider to manage systemd user sessions/linger'
26
commands loginctl: 'loginctl'
37

48
def self.instances

manifests/dropin_file.pp

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,19 @@
44
#
55
# @see systemd.unit(5)
66
#
7-
# @param name [Pattern['^[^/]+\.conf$']]
8-
# The target unit file to create
9-
#
10-
# @param path
11-
# The main systemd configuration path
12-
#
13-
# @param selinux_ignore_defaults
14-
# If Puppet should ignore the default SELinux labels.
15-
#
16-
# @param content
17-
# The full content of the unit file
18-
#
19-
# * Mutually exclusive with ``$source``
20-
#
21-
# @param source
22-
# The ``File`` resource compatible ``source``
23-
#
24-
# * Mutually exclusive with ``$content``
25-
#
26-
# @param target
27-
# If set, will force the file to be a symlink to the given target
28-
#
29-
# * Mutually exclusive with both ``$source`` and ``$content``
30-
#
31-
# @param owner
32-
# The owner to set on the dropin file
33-
#
34-
# @param group
35-
# The group to set on the dropin file
36-
#
37-
# @param mode
38-
# The mode to set on the dropin file
39-
#
40-
# @param show_diff
41-
# Whether to show the diff when updating dropin file
42-
#
43-
# @param notify_service
44-
# Notify a service for the unit, if it exists
7+
# @param unit the The target unit file to create, the value will be set to the `filename` parameter as well
8+
# @param filename The target unit file to create
9+
# @param ensure the state of this dropin file
10+
# @param path The main systemd configuration path
11+
# @param selinux_ignore_defaults If Puppet should ignore the default SELinux labels.
12+
# @param content The full content of the unit file (Mutually exclusive with `$source`)
13+
# @param source The `File` resource compatible `source` Mutually exclusive with ``$content``
14+
# @param target If set, will force the file to be a symlink to the given target (Mutually exclusive with both `$source` and `$content`
15+
# @param owner The owner to set on the dropin file
16+
# @param group The group to set on the dropin file
17+
# @param mode The mode to set on the dropin file
18+
# @param show_diff Whether to show the diff when updating dropin file
19+
# @param notify_service Notify a service for the unit, if it exists
4520
#
4621
define systemd::dropin_file (
4722
Systemd::Unit $unit,

manifests/init.pp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@
118118
#
119119
# @param network_path
120120
# where all networkd files are placed in
121+
#
122+
# @param manage_accounting
123+
# when enabled, the different accounting options (network traffic, IO, CPU util...) are enabled for units
124+
#
125+
# @param accounting
126+
# Hash of the different accounting options. This highly depends on the used systemd version. The module provides sane defaults.
127+
#
128+
# @param purge_dropin_dirs
129+
# When enabled, unused directories for dropin files will be purged
130+
#
121131
class systemd (
122132
Hash[String,Hash[String, Any]] $service_limits,
123133
Boolean $manage_resolved,

manifests/timer.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
# @param enable
5656
# If set, will manage the state of the unit.
5757
#
58+
# @param ensure
59+
# Defines the desired state of the timer
60+
#
5861
define systemd::timer (
5962
Enum['present', 'absent', 'file'] $ensure = 'present',
6063
Stdlib::Absolutepath $path = '/etc/systemd/system',

manifests/tmpfile.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# @see systemd-tmpfiles(8)
66
#
7-
# @param name [Pattern['^[^/]+\.conf$']] (filename)
7+
# @param filename
88
# The name of the tmpfile to create
99
#
1010
# @param ensure

types/dropin.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# @summary custom datatype that validates filenames/paths for valid systemd dropin files
12
type Systemd::Dropin = Pattern['^[^/]+\.conf$']

types/journaldsettings/ensure.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# @summary defines allowed ensure states for systemd-journald settings
12
type Systemd::JournaldSettings::Ensure = Struct[{ 'ensure' => Enum['present','absent'] }]

0 commit comments

Comments
 (0)