Select Git revision
unitfile.erb
-
Thomas Bellman authored
In systemd::unit and systemd::unit_options, support a special syntax in the hash of hashes for specifying comments on sections and on individual options, where the comments get written to the systemd unit file. The syntax is to specify a key with a name prefixed with a hash (#) sign. The comment will be inserted just before the corresponding section or option. For example: options => { 'Install' => { 'WantedBy' => 'multi-user.target' }, 'Service' => { 'ExecStart' => '/bin/true' 'User' => 'laureline', '#User' => "Don't run as Valerian", }, '#Service' => [ "This is a pretty silly service section,", "but we can test\nnewlines in the comment.", ], } will generate [Install] WantedBy=multi-user.target # This is a pretty silly service section, # but we can test # newlines in the comment. [Service] ExecStart=/bin/true # Don't run as Valerian User=laureline The idea is to be able to point out subtilities to readers of the generated unit file, so someone looking at a configured system doesn't have to go to the Puppet manifests to understand why something is done in a specific way. I'm not sure how useful this feature is, though. Perhaps users will be satisfied with having normal Puppet comments in the manifest source code, and reading those.
Thomas Bellman authoredIn systemd::unit and systemd::unit_options, support a special syntax in the hash of hashes for specifying comments on sections and on individual options, where the comments get written to the systemd unit file. The syntax is to specify a key with a name prefixed with a hash (#) sign. The comment will be inserted just before the corresponding section or option. For example: options => { 'Install' => { 'WantedBy' => 'multi-user.target' }, 'Service' => { 'ExecStart' => '/bin/true' 'User' => 'laureline', '#User' => "Don't run as Valerian", }, '#Service' => [ "This is a pretty silly service section,", "but we can test\nnewlines in the comment.", ], } will generate [Install] WantedBy=multi-user.target # This is a pretty silly service section, # but we can test # newlines in the comment. [Service] ExecStart=/bin/true # Don't run as Valerian User=laureline The idea is to be able to point out subtilities to readers of the generated unit file, so someone looking at a configured system doesn't have to go to the Puppet manifests to understand why something is done in a specific way. I'm not sure how useful this feature is, though. Perhaps users will be satisfied with having normal Puppet comments in the manifest source code, and reading those.