e2e-testing icon indicating copy to clipboard operation
e2e-testing copied to clipboard

E2E Add Auto-enroll on first startup new scenario

Open IgorGuz2000 opened this issue 4 years ago • 2 comments

Steps:

  1. Install agent with --delay-enroll option
  2. Check that agent is not started
  3. Restart the agent host
  4. Verify that agent started and enrolled to the Fleet

Overview

In cloud deployments and/or physical system deployments there is a case where you want an Elastic Agent to enroll into Fleet on first startup and not at installation time. Example being a prepared gold image for a cloud deployment, or a prepared sys-prepped Windows image for an organization. Idea

The idea is to add an option to the install command to not have it actually start the service and to not actually enroll at that time.

.\elastic-agent install --delay-enroll --url https://my.fleet.server --enrollment-token ${token}

Implementation

This would proceed to install the Elastic Agent, write an enroll.yml (with the url and enrollment token) file next to the elastic-agent.yml file and not start the service.

Then on the first start of the service (which is normally on boot up of a fresh deployment) then the Elastic Agent would notice that a enroll.yml file is present, load that perform enrollment, re-exec into Fleet mode, and then delete the enroll.yml.

IgorGuz2000 avatar Aug 24 '21 18:08 IgorGuz2000

https://github.com/elastic/beats/issues/26667

IgorGuz2000 avatar Aug 24 '21 18:08 IgorGuz2000

https://github.com/elastic/e2e-testing/issues/1512

IgorGuz2000 avatar Aug 30 '21 18:08 IgorGuz2000