# Elastic agent enrollment via configuration management

**URL:** <https://discuss.elastic.co/t/elastic-agent-enrollment-via-configuration-management/317515>\
**Category:** Elastic Cloud Enterprise (ECE)\
**Created:** [October 26, 2022, 12:10pm UTC](https://discuss.elastic.co/t/elastic-agent-enrollment-via-configuration-management/317515 "2022-10-26T12:10:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![UPPERCASE](https://avatars.discourse-cdn.com/v4/letter/u/ee7513/32.png) [@UPPERCASE](https://discuss.elastic.co/u/UPPERCASE)\
**Post date:** [October 26, 2022, 12:10pm UTC](https://discuss.elastic.co/t/elastic-agent-enrollment-via-configuration-management/317515/1 "2022-10-26T12:10:48Z")

</div>

In ECE clients are enrolled with `elastic-agent enroll --url=example.com:9243 --enrollment-token=$token` and then the rest is managed by Fleet.

However, I would like to enroll clients not with a command, but with a proper elastic-agent.yml file. Is this even a supported configuration path? I've tried to enroll clients by modifying the reference config with the URL and token, but no luck as it seems. The add agent window in Fleet also doesn't suggest an alternative way to install these clients. I prefer just setting up a config file, which makes configuration management much easier.

An alternative would be to run the enroll command, only if some sort of file is not present. This may work, but is not as straightforward as just updating a file and starting the daemon.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 9, 2022, 12:11pm UTC](https://discuss.elastic.co/t/elastic-agent-enrollment-via-configuration-management/317515/2 "2022-11-09T12:11:36Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
