Skip to content

Commit

Permalink
Address Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
enggnr committed Jul 10, 2023
1 parent 2dfb30a commit cd2a814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion home/.chezmoi.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ data:
docker:
doRegion: nyc1
domain: "{{ $domain }}"
elastic_fleet_server: "https://es-fleet.megabyte.space:8220"
elasticFleetServer: "https://elastic-fleet.{{ $PUBLIC_SERVICES_DOMAIN }}:8220"
headless: {{ $headless }}
home: "{{ .chezmoi.homeDir }}"
homeParentFolder: "{{ if eq .chezmoi.os "linux" }}/home{{ else if eq .chezmoi.os "darwin" }}/Users{{ else }}C:\Users{{ end }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if and (ne .host.distro.family "windows") (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (or (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "ELASTIC_TOKEN")) (env "ELASTIC_TOKEN")) -}}
#!/usr/bin/env bash
# @file Netdata
# @file Elastic Fleet Server
# @brief Enrolls Elastic Agent with Elastic Fleet Server
# @description
# This script enrolls Elastic Agent with Elastic Fleet Server if Elastic Agent is installed, the `ELASTIC_TOKEN` is provided, and the
# `elastic_fleet_server` is defined.
# `elasticFleetServer` is defined.
#
# Fleet provides a web-based UI in Kibana for centrally managing Elastic Agents and their policies. Fleet Server is the mechanism
# to connect Elastic Agents to Fleet. All communication between the Fleet UI and Fleet Server happens through Elasticsearch.
Expand All @@ -19,7 +19,7 @@
### Enroll Elastic Agent with Elastic Fleet Server
if command -v elastic-agent > /dev/null; then
ELASTIC_TOKEN="{{- if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "ELASTIC_TOKEN")) -}}{{- includeTemplate "secrets/ELASTIC_TOKEN" | decrypt | trim -}}{{- else -}}{{- env "ELASTIC_TOKEN" -}}{{- end -}}"
FLEET_URL="{{ .host.data.elastic_fleet_server }}"
FLEET_URL="{{ .host.data.elasticFleetServer }}"
logg info 'Enrolling Elastic Agent'
sudo elastic-agent install --url="$FLEET_URL" --enrollment-token="$ELASTIC_TOKEN"
else
Expand Down

0 comments on commit cd2a814

Please sign in to comment.