Skip to content

Commit

Permalink
[8.15] Fix order of operations in instructions. (#195503) (#195605)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.15`:
- [Fix order of operations in instructions.
(#195503)](#195503)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Ryan
Hass","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-09T00:01:48Z","message":"Fix
order of operations in instructions. (#195503)\n\n## Summary\r\n\r\nThe
enroll command must be executed after the elastic-agent is
running.\r\nThis updates the instructions so that users are told to
enable and start\r\nthe agent before running the `enroll` command to
ensure the socket file\r\nis created and available.\r\n\r\nThis fixes
issues with errors like
this:\r\n\r\n```\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:06.857Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":518},\"message\":\"Starting
enrollment to URL:
https://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:08.681Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":481},\"message\":\"Restarting
agent daemon, attempt
0\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"error\",\"@timestamp\":\"2024-10-08T20:47:08.683Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":495},\"message\":\"Restart
attempt 0 failed: 'rpc error: code = Unavailable desc = connection
error: desc = \\\"transport: Error while dialing: dial unix
/usr/share/elastic-agent/elastic-agent.sock: connect: no such file or
directory\\\"'. Waiting for
2s\",\"ecs.version\":\"1.6.0\"}\r\n```\r\n\r\n###
Checklist\r\n\r\nN/A\r\n\r\n### For maintainers\r\n\r\n- [ ] This was
checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"13c2c7663546da0f6b34e5dd85932ebc74ecafa7","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-major","v8.16.0"],"number":195503,"url":"https://github.com/elastic/kibana/pull/195503","mergeCommit":{"message":"Fix
order of operations in instructions. (#195503)\n\n## Summary\r\n\r\nThe
enroll command must be executed after the elastic-agent is
running.\r\nThis updates the instructions so that users are told to
enable and start\r\nthe agent before running the `enroll` command to
ensure the socket file\r\nis created and available.\r\n\r\nThis fixes
issues with errors like
this:\r\n\r\n```\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:06.857Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":518},\"message\":\"Starting
enrollment to URL:
https://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:08.681Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":481},\"message\":\"Restarting
agent daemon, attempt
0\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"error\",\"@timestamp\":\"2024-10-08T20:47:08.683Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":495},\"message\":\"Restart
attempt 0 failed: 'rpc error: code = Unavailable desc = connection
error: desc = \\\"transport: Error while dialing: dial unix
/usr/share/elastic-agent/elastic-agent.sock: connect: no such file or
directory\\\"'. Waiting for
2s\",\"ecs.version\":\"1.6.0\"}\r\n```\r\n\r\n###
Checklist\r\n\r\nN/A\r\n\r\n### For maintainers\r\n\r\n- [ ] This was
checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"13c2c7663546da0f6b34e5dd85932ebc74ecafa7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195503","number":195503,"mergeCommit":{"message":"Fix
order of operations in instructions. (#195503)\n\n## Summary\r\n\r\nThe
enroll command must be executed after the elastic-agent is
running.\r\nThis updates the instructions so that users are told to
enable and start\r\nthe agent before running the `enroll` command to
ensure the socket file\r\nis created and available.\r\n\r\nThis fixes
issues with errors like
this:\r\n\r\n```\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:06.857Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":518},\"message\":\"Starting
enrollment to URL:
https://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"info\",\"@timestamp\":\"2024-10-08T20:47:08.681Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":481},\"message\":\"Restarting
agent daemon, attempt
0\",\"ecs.version\":\"1.6.0\"}\r\n{\"log.level\":\"error\",\"@timestamp\":\"2024-10-08T20:47:08.683Z\",\"log.origin\":{\"function\":\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\",\"file.name\":\"cmd/enroll_cmd.go\",\"file.line\":495},\"message\":\"Restart
attempt 0 failed: 'rpc error: code = Unavailable desc = connection
error: desc = \\\"transport: Error while dialing: dial unix
/usr/share/elastic-agent/elastic-agent.sock: connect: no such file or
directory\\\"'. Waiting for
2s\",\"ecs.version\":\"1.6.0\"}\r\n```\r\n\r\n###
Checklist\r\n\r\nN/A\r\n\r\n### For maintainers\r\n\r\n- [ ] This was
checked for breaking API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"13c2c7663546da0f6b34e5dd85932ebc74ecafa7"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/195524","number":195524,"state":"MERGED","mergeCommit":{"sha":"d3c0b006da9d607904f9e395849b99cf11a4413f","message":"[8.x]
Fix order of operations in instructions. (#195503) (#195524)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`8.x`:\n- [Fix order of operations in
instructions.\n(#195503)](https://github.com/elastic/kibana/pull/195503)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Ryan\nHass\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-09T00:01:48Z\",\"message\":\"Fix\norder
of operations in instructions. (#195503)\\n\\n##
Summary\\r\\n\\r\\nThe\nenroll command must be executed after the
elastic-agent is\nrunning.\\r\\nThis updates the instructions so that
users are told to\nenable and start\\r\\nthe agent before running the
`enroll` command to\nensure the socket file\\r\\nis created and
available.\\r\\n\\r\\nThis fixes\nissues with errors
like\nthis:\\r\\n\\r\\n```\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:06.857Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":518},\\\"message\\\":\\\"Starting\nenrollment
to
URL:\nhttps://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.681Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":481},\\\"message\\\":\\\"Restarting\nagent
daemon,
attempt\n0\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"error\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.683Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":495},\\\"message\\\":\\\"Restart\nattempt
0 failed: 'rpc error: code = Unavailable desc = connection\nerror: desc
= \\\\\\\"transport: Error while dialing: dial
unix\n/usr/share/elastic-agent/elastic-agent.sock: connect: no such file
or\ndirectory\\\\\\\"'. Waiting
for\n2s\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n```\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\nN/A\\r\\n\\r\\n###
For maintainers\\r\\n\\r\\n- [ ] This was\nchecked for breaking API
changes and
was\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"13c2c7663546da0f6b34e5dd85932ebc74ecafa7\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.16.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:skip\",\"Team:Fleet\",\"v9.0.0\",\"backport:prev-major\"],\"title\":\"Fix\norder
of operations
in\ninstructions.\",\"number\":195503,\"url\":\"https://github.com/elastic/kibana/pull/195503\",\"mergeCommit\":{\"message\":\"Fix\norder
of operations in instructions. (#195503)\\n\\n##
Summary\\r\\n\\r\\nThe\nenroll command must be executed after the
elastic-agent is\nrunning.\\r\\nThis updates the instructions so that
users are told to\nenable and start\\r\\nthe agent before running the
`enroll` command to\nensure the socket file\\r\\nis created and
available.\\r\\n\\r\\nThis fixes\nissues with errors
like\nthis:\\r\\n\\r\\n```\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:06.857Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":518},\\\"message\\\":\\\"Starting\nenrollment
to
URL:\nhttps://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.681Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":481},\\\"message\\\":\\\"Restarting\nagent
daemon,
attempt\n0\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"error\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.683Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":495},\\\"message\\\":\\\"Restart\nattempt
0 failed: 'rpc error: code = Unavailable desc = connection\nerror: desc
= \\\\\\\"transport: Error while dialing: dial
unix\n/usr/share/elastic-agent/elastic-agent.sock: connect: no such file
or\ndirectory\\\\\\\"'. Waiting
for\n2s\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n```\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\nN/A\\r\\n\\r\\n###
For maintainers\\r\\n\\r\\n- [ ] This was\nchecked for breaking API
changes and
was\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"13c2c7663546da0f6b34e5dd85932ebc74ecafa7\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/195503\",\"number\":195503,\"mergeCommit\":{\"message\":\"Fix\norder
of operations in instructions. (#195503)\\n\\n##
Summary\\r\\n\\r\\nThe\nenroll command must be executed after the
elastic-agent is\nrunning.\\r\\nThis updates the instructions so that
users are told to\nenable and start\\r\\nthe agent before running the
`enroll` command to\nensure the socket file\\r\\nis created and
available.\\r\\n\\r\\nThis fixes\nissues with errors
like\nthis:\\r\\n\\r\\n```\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:06.857Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":518},\\\"message\\\":\\\"Starting\nenrollment
to
URL:\nhttps://<REDACTED>.fleet.us-west-2.aws.elastic.cloud:443/\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"info\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.681Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":481},\\\"message\\\":\\\"Restarting\nagent
daemon,
attempt\n0\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n{\\\"log.level\\\":\\\"error\\\",\\\"@timestamp\\\":\\\"2024-10-08T20:47:08.683Z\\\",\\\"log.origin\\\":{\\\"function\\\":\\\"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff\\\",\\\"file.name\\\":\\\"cmd/enroll_cmd.go\\\",\\\"file.line\\\":495},\\\"message\\\":\\\"Restart\nattempt
0 failed: 'rpc error: code = Unavailable desc = connection\nerror: desc
= \\\\\\\"transport: Error while dialing: dial
unix\n/usr/share/elastic-agent/elastic-agent.sock: connect: no such file
or\ndirectory\\\\\\\"'. Waiting
for\n2s\\\",\\\"ecs.version\\\":\\\"1.6.0\\\"}\\r\\n```\\r\\n\\r\\n###\nChecklist\\r\\n\\r\\nN/A\\r\\n\\r\\n###
For maintainers\\r\\n\\r\\n- [ ] This was\nchecked for breaking API
changes and
was\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"13c2c7663546da0f6b34e5dd85932ebc74ecafa7\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Ryan Hass <[email protected]>"}}]}] BACKPORT-->
  • Loading branch information
rhass authored Oct 9, 2024
1 parent daefd92 commit 37b7ee2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--x86_64.rpm
sudo rpm -vi elastic-agent--x86_64.rpm
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand All @@ -93,12 +93,12 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--amd64.deb
sudo dpkg -i elastic-agent--amd64.deb
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand Down Expand Up @@ -199,13 +199,13 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--x86_64.rpm
sudo rpm -vi elastic-agent--x86_64.rpm
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand All @@ -220,13 +220,13 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--amd64.deb
sudo dpkg -i elastic-agent--amd64.deb
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
--fleet-server-policy=policy-1 \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});
});
Expand Down Expand Up @@ -356,6 +356,8 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--x86_64.rpm
sudo rpm -vi elastic-agent--x86_64.rpm
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll --url=http://fleetserver:8220 \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
Expand All @@ -364,9 +366,7 @@ describe('getInstallCommandForPlatform', () => {
--fleet-server-es-ca=<PATH_TO_ES_CERT> \\\\
--fleet-server-cert=<PATH_TO_FLEET_SERVER_CERT> \\\\
--fleet-server-cert-key=<PATH_TO_FLEET_SERVER_CERT_KEY> \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});

Expand All @@ -383,6 +383,8 @@ describe('getInstallCommandForPlatform', () => {
expect(res).toMatchInlineSnapshot(`
"curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent--amd64.deb
sudo dpkg -i elastic-agent--amd64.deb
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent
sudo elastic-agent enroll --url=http://fleetserver:8220 \\\\
--fleet-server-es=http://elasticsearch:9200 \\\\
--fleet-server-service-token=service-token-1 \\\\
Expand All @@ -391,9 +393,7 @@ describe('getInstallCommandForPlatform', () => {
--fleet-server-es-ca=<PATH_TO_ES_CERT> \\\\
--fleet-server-cert=<PATH_TO_FLEET_SERVER_CERT> \\\\
--fleet-server-cert-key=<PATH_TO_FLEET_SERVER_CERT_KEY> \\\\
--fleet-server-port=8220
sudo systemctl enable elastic-agent
sudo systemctl start elastic-agent"
--fleet-server-port=8220"
`);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ export function getInstallCommandForPlatform(
linux: `${artifact.downloadCommand}\nsudo ./elastic-agent install ${commandArgumentsStr}`,
mac: `${artifact.downloadCommand}\nsudo ./elastic-agent install ${commandArgumentsStr}`,
windows: `${artifact.downloadCommand}\n.\\elastic-agent.exe install ${commandArgumentsStr}`,
deb: `${artifact.downloadCommand}\nsudo elastic-agent enroll ${commandArgumentsStr}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent`,
rpm: `${artifact.downloadCommand}\nsudo elastic-agent enroll ${commandArgumentsStr}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent`,
deb: `${artifact.downloadCommand}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent\nsudo elastic-agent enroll ${commandArgumentsStr}`,
rpm: `${artifact.downloadCommand}\nsudo systemctl enable elastic-agent\nsudo systemctl start elastic-agent\nsudo elastic-agent enroll ${commandArgumentsStr}`,
kubernetes: '',
cloudFormation: '',
googleCloudShell: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ cd elastic-agent-${agentVersion}-windows-x86_64

const linuxDebCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb
sudo dpkg -i elastic-agent-${agentVersion}-amd64.deb
sudo elastic-agent enroll ${enrollArgs} \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`;
sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${enrollArgs} \n`;

const linuxRpmCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm
sudo rpm -vi elastic-agent-${agentVersion}-x86_64.rpm
sudo elastic-agent enroll ${enrollArgs} \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`;
sudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent \nsudo elastic-agent enroll ${enrollArgs} \n`;

const googleCloudShellCommand = `gcloud config set project ${gcpProjectId} && ${
gcpAccountType === 'organization-account' ? `ORG_ID=${gcpOrganizationId}` : ``
Expand Down

0 comments on commit 37b7ee2

Please sign in to comment.