# Agent deployment failed with ansible template

**URL:** <https://forum.ansible.com/t/agent-deployment-failed-with-ansible-template/44888>\
**Category:** Get Help\
**Tags:** azure, windows\
**Created:** [November 24, 2025, 9:41am UTC](https://forum.ansible.com/t/agent-deployment-failed-with-ansible-template/44888 "2025-11-24T09:41:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarun](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@tarun](https://forum.ansible.com/u/tarun)\
**Post date:** [November 24, 2025, 9:41am UTC](https://forum.ansible.com/t/agent-deployment-failed-with-ansible-template/44888/1 "2025-11-24T09:41:15Z")

</div>

We are deploying azdevops self hosted agent using ansible template but i see it failed with following error, Please suggest

fatal: [SERVER]: FAILED! =\> {“changed”: false, “cmd”: “cmd.exe /c type "C:\\Temp\\Azure-DevOps-ENV-Agent-Config-4279336.log"”, “delta”: “”, “end”: “”, “failed\_when\_result”: true, “rc”: 0, “start”: “”, “stderr”: “”, “stderr\_lines”: , “stdout”: "Request Numbers:\n()\r\nINITIAL State of INPUT Parameters:\nazdoAgentType (ENVIRONMENT)\nazdoAgentName (SERVER-ENV-CIP-13713-F-QA)\nazdoAgentHome ()\nazdoAgentPool ()\nazdoProject (Chile Ins Presales and Sales ART)\nazdoDeploymentGroup ()\nazdoEnvironment (13713\_metlifecl\_pre\_BackOffice\_Digital\_Front-qa)\nazdoWindowsAgentDownloadLink ([https://download.agent.dev.azure.com/agent/4.264.2/vsts-agent-win-x64-4.264.2.zip](https://download.agent.dev.azure.com/agent/4.264.2/vsts-agent-win-x64-4.264.2.zip))\nazdoOrgURL (nazdoAgentWorkFolder (\_work)\nconfigOption (INSTALL)\r\nUPDATED state of INPUT Parameters:\nazdoAgentType (ENVIRONMENT)\nazdoAgentName (SERVER-ENV-CIP-bb)\nazdoAgentHome (D:/azagent-EN…

---

<div class="post-metadata">

**Author:** ![gundalow](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gundalow/32/99_2.png) [@gundalow](https://forum.ansible.com/u/gundalow)\
**Post date:** [November 24, 2025, 9:42am UTC](https://forum.ansible.com/t/agent-deployment-failed-with-ansible-template/44888/2 "2025-11-24T09:42:43Z")

</div>

@tarun Welcome to the Ansible Forum.

1. Is that the full error message, it appears to be truncated.
2. Can you please include the task & template that triggered this error. Remember to redact any confidential information

---

<div class="post-metadata">

**Author:** ![Ruth\_4590](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@Ruth\_4590](https://forum.ansible.com/u/Ruth_4590)\
**Post date:** [December 30, 2025, 10:05am UTC](https://forum.ansible.com/t/agent-deployment-failed-with-ansible-template/44888/4 "2025-12-30T10:05:28Z")

</div>

This isn’t a bug in Ansible; the log shows that inputs are missing:

azdoAgentHome() azdoAgentPool()

Both are empty, which causes the Azure DevOps agent config to fail. Quick checks:

even in ENVIRONMENT mode, define azdoAgentPool

Before setting up, make sure azdoAgentHome exists.

make sure azdoOrgURL is complete

run the task as an administrator on Windows

The cmd.exe /c type failure just means that the config script stopped running before it was supposed to. This is usually caused by missing variables or bad input, not a problem with the platform.

---

<div class="post-metadata">

**Author:** ![pureeaglepiscesmilk](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@pureeaglepiscesmilk](https://forum.ansible.com/u/pureeaglepiscesmilk)\
**Post date:** [January 5, 2026, 8:30pm UTC](https://forum.ansible.com/t/agent-deployment-failed-with-ansible-template/44888/5 "2026-01-05T20:30:52Z")

</div>

I’ve seen this error before. It looks like the AzDO agent config task is running but failing due to some weird characters in the log file path. Try removing the quotes around the log file path in your ansible template. That usually fixes the issue.
