-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add enable and active parameters to unit_file #69
Conversation
Allows the deployed units to be enabled and/or started by the module. By default it will leave the units unmanaged.
@@ -57,4 +65,14 @@ | |||
mode => '0444', | |||
notify => Class['systemd::systemctl::daemon_reload'], | |||
} | |||
|
|||
if $enable != undef or $active != undef { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously it was mentioned there are other unit files like mount
or timer
. Can service
handle those as well or should we use a regex like $name =~ /^.+\.service$/
in this if as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service
native resource can definitely handle other types of unit files, as long as the provider is set as systemd
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be noted, however, that unless a unit type suffix is used as the resource name (eg. .mount
or .timer
, it will default to a service unit type.
It'd be good if there was a testcase for this. |
I wish I could write this testcase myself but I don't know enough about puppet module tests to do so myself, at his time. |
@jcharaoui have you checked the existing tests in https://github.com/camptocamp/puppet-systemd/blob/master/spec/classes/init_spec.rb ? Is that something that helps you? If you've any questions about writing tests, Puppet, or rspec-puppet (the unit testing framework) feel ree to join the IRC channel #voxpupuli on freenode from the Puppet Community. We're happy to help out. |
Thanks for the tests @jcharaoui ! |
Add missing quote
Allows the deployed units to be enabled and/or started by the module. By default it will leave the units unmanaged.
This is an attempt to supersede PR #55 for which the original submitter appears to have lost interest.