Skip to content
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

Datadog windows agent not restarting after configuration #346

Closed
lognarly opened this issue Apr 16, 2021 · 5 comments · Fixed by #347
Closed

Datadog windows agent not restarting after configuration #346

lognarly opened this issue Apr 16, 2021 · 5 comments · Fixed by #347

Comments

@lognarly
Copy link

ansible [core 2.11.0b3]
config file = None
configured module search path = ['/Users/logan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
ansible collection location = /Users/logan/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.4 (default, Apr 5 2021, 01:50:46) [Clang 12.0.0 (clang-1200.0.32.29)]
jinja version = 2.11.3
libyaml = False

TASK [datadog.datadog : Create main Datadog agent configuration file] ******************************************************************************************
task path: /Users/logan/.ansible/roles/datadog.datadog/tasks/agent-win.yml:2
redirecting (type: action) ansible.builtin.win_template to ansible.windows.win_template
redirecting (type: action) ansible.builtin.win_template to ansible.windows.win_template
<3.236.226.251> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 3.236.226.251
EXEC (via pipeline wrapper)
Using module file /Users/logan/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_copy.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
EXEC (via pipeline wrapper)
<3.236.226.251> PUT "/Users/logan/.ansible/tmp/ansible-local-149354nukjptf/tmpsvkcefm9/datadog.yaml.j2" TO "C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1618600099.09283-15004-108442421700393\source"
Using module file /Users/logan/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_copy.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
EXEC (via pipeline wrapper)
ERROR! The requested handler 'restart datadog-agent-win' was not found in either the main handlers list nor in the listening handlers list

I am on the latest version of the role.

@KSerrania
Copy link
Contributor

Hey @lognarly,

Thanks for the report! I can reproduce your issue, it seems like there's a typo in one of the handlers files which causes this error on Windows. #347 should fix this.

@bkabrda
Copy link
Contributor

bkabrda commented Apr 19, 2021

Version 4.8.1 was just released which fixes the typo and should make everything work fine. Thanks again for the report!

@lognarly
Copy link
Author

I am still having this issue:

TASK [datadog.datadog : Create main Datadog agent configuration file] *******************************************************************************
task path: /Users/logan/.ansible/roles/datadog.datadog/tasks/agent-win.yml:2
<3.233.232.6> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 3.233.232.6
EXEC (via pipeline wrapper)
Using module file /Users/logan/.pyenv/versions/3.9.4/lib/python3.9/site-packages/ansible/modules/windows/win_stat.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
<3.233.232.6> PUT "/Users/logan/.ansible/tmp/ansible-local-38838s0p6umsj/tmp80w0prpb/datadog.yaml.j2" TO "C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1618947905.791906-38956-115640626465035\source"
Using module file /Users/logan/.pyenv/versions/3.9.4/lib/python3.9/site-packages/ansible/modules/windows/win_copy.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)
EXEC (via pipeline wrapper)
ERROR! The requested handler 'restart datadog-agent-win' was not found in either the main handlers list nor in the listening handlers list

Logans-MBP:ansible logan$ ansible --version
ansible 2.9.13
config file = None
configured module search path = ['/Users/logan/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/logan/.pyenv/versions/3.9.4/lib/python3.9/site-packages/ansible
executable location = /Users/logan/.pyenv/versions/3.9.4/bin/ansible
python version = 3.9.4 (default, Apr 20 2021, 15:17:09) [Clang 12.0.0 (clang-1200.0.32.29)]

On 4.8.1, and here are the handler files:

  • name: restart datadog-agent-win
    win_service:
    name: datadogagent
    state: restarted
    force_dependent_services: true
    when: datadog_enabled and not ansible_check_mode

  • name: restart datadog-agent-sysprobe
    service:
    name: datadog-agent-sysprobe
    state: restarted
    when: datadog_enabled and datadog_sysprobe_enabled and not ansible_check_mode and not ansible_facts.os_family == "Windows"

  • name: restart datadog-agent
    service:
    name: datadog-agent
    state: restarted
    when: datadog_enabled and not ansible_check_mode and not ansible_facts.os_family == "Windows"

  • include_tasks: handlers/main-win.yml
    when: ansible_facts.os_family == "Windows"

@bkabrda
Copy link
Contributor

bkabrda commented Apr 21, 2021

Hi @lognarly, we've just released 4.8.2 that fixes this issue. Sorry for the inconvenience. We have identified some gaps in how we do testing of the role for windows and will work to improve the quality of upcoming releases. Thank you again for reporting this!

@lognarly
Copy link
Author

Just ran through a deployment, and confirmed it works. Thanks!

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 a pull request may close this issue.

3 participants