Skip to content

Commit

Permalink
[Ingest Manager] During fleet setup create an enrollment for every co…
Browse files Browse the repository at this point in the history
…nfig (#71308)
  • Loading branch information
nchaulet authored Jul 13, 2020
1 parent 0a516cf commit a906c73
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions x-pack/plugins/ingest_manager/server/services/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,18 @@ export async function setupFleet(
fleet_enroll_password: password,
});

// Generate default enrollment key
await generateEnrollmentAPIKey(soClient, {
name: 'Default',
configId: await agentConfigService.getDefaultAgentConfigId(soClient),
const { items: agentConfigs } = await agentConfigService.list(soClient, {
perPage: 10000,
});

await Promise.all(
agentConfigs.map((agentConfig) => {
return generateEnrollmentAPIKey(soClient, {
name: `Default`,
configId: agentConfig.id,
});
})
);
}

function generateRandomPassword() {
Expand Down

0 comments on commit a906c73

Please sign in to comment.