Role stops service when started by timer #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue when this role is executed and any
systemd
service
unit
is currently running (i.e. statestarted
). When the role updates its definitions ofsystemd
unit files, it ensures that the running state conforms to the value ofunit_item.state
or_default_unit_state
. This is done in the task titled "Activate configured Systemd units".Since it is started by a
systemd
timer
and according to the role, it is not supposed to be enabled, hence the service is shutdown. This could happen to any serviceunit
that is supposed to be in astopped
state. This "anomaly" I would like to address in this PR.When you do not want the role to enforce the state of the service (
stopped
,started
), simply by adding the variableunit_item.manage_state
it tells the roles systemd task to either manage the state, or simple omitting the state setting.This configuration will create a unit with a
state
that will not be managed by this role since themanage_state
is set to false.We could name the variable
enforce_state
instead ofmanage_state
.Fixes #53