diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.test.ts b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.test.ts index c86811da2fde7..e00adaa13a414 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.test.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.test.ts @@ -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" `); }); @@ -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" `); }); @@ -196,13 +196,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" `); }); @@ -217,13 +217,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" `); }); }); @@ -349,6 +349,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 \\\\ @@ -357,9 +359,7 @@ describe('getInstallCommandForPlatform', () => { --fleet-server-es-ca= \\\\ --fleet-server-cert= \\\\ --fleet-server-cert-key= \\\\ - --fleet-server-port=8220 - sudo systemctl enable elastic-agent - sudo systemctl start elastic-agent" + --fleet-server-port=8220" `); }); @@ -376,6 +376,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 \\\\ @@ -384,9 +386,7 @@ describe('getInstallCommandForPlatform', () => { --fleet-server-es-ca= \\\\ --fleet-server-cert= \\\\ --fleet-server-cert-key= \\\\ - --fleet-server-port=8220 - sudo systemctl enable elastic-agent - sudo systemctl start elastic-agent" + --fleet-server-port=8220" `); }); }); @@ -547,14 +547,14 @@ describe('getInstallCommandForPlatform', () => { expect(res).toMatchInlineSnapshot(` "curl -L -O https://download-src/8.12.0-test/beats/elastic-agent/elastic-agent--x86_64.rpm --proxy http://download-src-proxy:2222 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 \\\\ - --proxy-url=http://es-proxy:1111 - sudo systemctl enable elastic-agent - sudo systemctl start elastic-agent" + --proxy-url=http://es-proxy:1111" `); }); @@ -589,14 +589,14 @@ describe('getInstallCommandForPlatform', () => { expect(res).toMatchInlineSnapshot(` "curl -L -O https://download-src/8.12.0-test/beats/elastic-agent/elastic-agent--amd64.deb --proxy http://download-src-proxy:2222 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 \\\\ - --proxy-url=http://es-proxy:1111 - sudo systemctl enable elastic-agent - sudo systemctl start elastic-agent" + --proxy-url=http://es-proxy:1111" `); }); }); @@ -795,6 +795,8 @@ describe('getInstallCommandForPlatform', () => { expect(res).toMatchInlineSnapshot(` "curl -L -O https://download-src/8.12.0-test/beats/elastic-agent/elastic-agent--x86_64.rpm --proxy http://download-src-proxy:2222 --proxy-header \\"Accept-Language=en-US,en;q=0.5\\" --proxy-header \\"second-header=second-value\\" 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 \\\\ @@ -802,9 +804,7 @@ describe('getInstallCommandForPlatform', () => { --fleet-server-port=8220 \\\\ --proxy-url=http://es-proxy:1111 \\\\ --proxy-header=\\"X-Forwarded-For=forwarded-value\\" \\\\ - --proxy-header=\\"test-header=test-value\\" - sudo systemctl enable elastic-agent - sudo systemctl start elastic-agent" + --proxy-header=\\"test-header=test-value\\"" `); }); @@ -847,6 +847,8 @@ describe('getInstallCommandForPlatform', () => { expect(res).toMatchInlineSnapshot(` "curl -L -O https://download-src/8.12.0-test/beats/elastic-agent/elastic-agent--amd64.deb --proxy http://download-src-proxy:2222 --proxy-header \\"Accept-Language=en-US,en;q=0.5\\" --proxy-header \\"second-header=second-value\\" 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 \\\\ @@ -854,9 +856,7 @@ describe('getInstallCommandForPlatform', () => { --fleet-server-port=8220 \\\\ --proxy-url=http://es-proxy:1111 \\\\ --proxy-header=\\"X-Forwarded-For=forwarded-value\\" \\\\ - --proxy-header=\\"test-header=test-value\\" - sudo systemctl enable elastic-agent - sudo systemctl start elastic-agent" + --proxy-header=\\"test-header=test-value\\"" `); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.ts b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.ts index 5656e49de4bc9..0264adc879907 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/utils/install_command_utils.ts @@ -154,8 +154,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: '', diff --git a/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx b/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx index 654b3a782649c..27b98bdc1acbe 100644 --- a/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx +++ b/x-pack/plugins/fleet/public/components/enrollment_instructions/manual/index.tsx @@ -107,11 +107,11 @@ cd elastic-agent-${agentVersion}-windows-x86_64 const linuxDebCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} 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 ${curlDownloadSourceProxyArgs} 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}` : ``