-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow percent (%) character in unit names.
This allows relations to be set up between similar instances of two templated units. For example: ```puppet systemd::manage_dropin{'user-aklog.conf': ensure => present, unit => '[email protected]', unit_entry => { 'Documentation' => 'Run an aklog log before we start systemd --user', 'After' => ['user-aklog@%i.service'], 'Requires' => ['user-aklog@%i.service'], }, } ``` Previously the `%` character was considered illegal in a unit name.
- Loading branch information
1 parent
9ab215d
commit b80a8ea
Showing
5 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -837,6 +837,18 @@ systemd::manage_dropin { 'maxloglevel.conf': | |
} | ||
``` | ||
|
||
##### have a unit instance auto run before user-<uid>.service | ||
|
||
```puppet | ||
systemd::manage_dropin { 'user-aklog.conf': | ||
unit => '[email protected]', | ||
unit_entry => { | ||
'After' => 'user-aklog@%i.service', | ||
'Requires' => 'user-aklog@%i.service' | ||
} | ||
} | ||
``` | ||
|
||
#### Parameters | ||
|
||
The following parameters are available in the `systemd::manage_dropin` defined type: | ||
|
@@ -2289,7 +2301,7 @@ custom datatype that validates different filenames for systemd units and unit te | |
* **See also** | ||
* https://www.freedesktop.org/software/systemd/man/systemd.unit.html | ||
|
||
Alias of `Pattern[/^[a-zA-Z0-9:\-_.\\@]+\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)$/]` | ||
Alias of `Pattern[/^[a-zA-Z0-9:\-_.\\@%]+\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)$/]` | ||
|
||
### <a name="Systemd--Unit--Install"></a>`Systemd::Unit::Install` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,15 @@ | |
# } | ||
# } | ||
# | ||
# @example have a unit instance auto run before user-<uid>.service | ||
# systemd::manage_dropin { 'user-aklog.conf': | ||
# unit => '[email protected]', | ||
# unit_entry => { | ||
# 'After' => 'user-aklog@%i.service', | ||
# 'Requires' => 'user-aklog@%i.service' | ||
# } | ||
# } | ||
# | ||
# @param unit The unit to create a dropfile for | ||
# @param filename The target unit file to create. The filename of the drop in. The full path is determined using the path, unit and this filename. | ||
# @param ensure The state of this dropin file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# @summary custom datatype that validates different filenames for systemd units and unit templates | ||
# @see https://www.freedesktop.org/software/systemd/man/systemd.unit.html | ||
type Systemd::Unit = Pattern[/^[a-zA-Z0-9:\-_.\\@]+\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)$/] | ||
type Systemd::Unit = Pattern[/^[a-zA-Z0-9:\-_.\\@%]+\.(service|socket|device|mount|automount|swap|target|path|timer|slice|scope)$/] |