Skip to content

Conversation

@kevinconaway
Copy link
Contributor

If the system probe is not installed or is explicitly disabled, we should ensure that the service is stopped.

This covers the use case where the probe had been previously enabled and then disabled.

@kevinconaway kevinconaway requested review from a team January 16, 2020 16:00
name: datadog-agent-sysprobe
state: stopped
enabled: no
when: not datadog_skip_running_check and (not datadog_enabled or not datadog_sysprobe_enabled)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's prevent this from running when ansible is in check mode (same as the running check above):

Suggested change
when: not datadog_skip_running_check and (not datadog_enabled or not datadog_sysprobe_enabled)
when: not datadog_skip_running_check and not ansible_check_mode and (not datadog_enabled or not datadog_sysprobe_enabled)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I omitted that is the task to stop the main agent does not include it.

Does it still make sense to include?

Copy link
Contributor

@KSerrania KSerrania Jan 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this is an error, as this means the role may do something when run in check mode (for instance, if an Agent was running on the target host, the role may stop it).
But for now, let's keep the role behaviour coherent and leave this out. I'll investigate this in another PR.

@kevinconaway kevinconaway merged commit 1ca3449 into master Jan 17, 2020
@kevinconaway kevinconaway deleted the kevinconaway/ansible-stop-sysprobe branch January 17, 2020 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants