-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error when trying to ensure non-existent services are stopped
When managing the `ensure` state for a service, the provider queries the service status to determine if it's running or not. However, if the service doesn't exist, then it returns that the service is `stopped`. When trying to ensure a non-existent service is stopped, puppet thinks the service is "insync", so returns exit code 0. This commit updates the systemd provider's enable method to return either :running, :stopped or :absent. To differentiate between `stopped` vs `absent`, the provider first checks if the service exists. This adds `absent` as a valid value for the `ensure` property, however, it can't be set on a provider, since we don't want to remove services: puppet resource service ufw ensure=absent Error: The systemd provider can not handle attribute ensure
- Loading branch information
1 parent
03b3df3
commit f754cf7
Showing
3 changed files
with
20 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
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