-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Windows handlers definition (#349)
Dynamically includes the Windows Agent restart handler to make it work as expected.
- Loading branch information
Showing
2 changed files
with
15 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
--- | ||
|
||
- name: restart datadog-agent-win | ||
# This file doesn't actually contain "handlers" in the Ansible sense: when running | ||
# our role, Ansible only loads the contents of handlers/main.yml as handlers. | ||
# However, this is here because this is a "handler-like" task that is dynamically | ||
# included by a handler task in handlers/main.yml. | ||
- name: Restart Windows datadogagent service | ||
win_service: | ||
name: datadogagent | ||
state: restarted | ||
force_dependent_services: true | ||
when: datadog_enabled and not ansible_check_mode | ||
when: datadog_enabled and not ansible_check_mode and ansible_facts.os_family == "Windows" |
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