Skip to content

Commit

Permalink
Add FLEET_ENROLL_INSECURE env var to expose --insecure CLI option (el…
Browse files Browse the repository at this point in the history
…astic#20713)

* Add FLEET_ENROLL_INSECURE env var to expose --insecure CLI option

* Adding CHANGELOG entry

* Adding issue to CHANGELOG entry
# Conflicts:
#	x-pack/elastic-agent/CHANGELOG.asciidoc
  • Loading branch information
ycombinator committed Aug 21, 2020
1 parent 89a7faf commit 350e8a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -eo pipefail
# FLEET_CONFIG_ID - config related to new token [defaul]
# FLEET_ENROLLMENT_TOKEN - existing enrollment token to be used for enroll
# FLEET_ENROLL - if set to 1 enroll will be performed
# FLEET_ENROLL_INSECURE - if set to 1, agent will enroll with fleet using --insecure flag
# FLEET_SETUP - if set to 1 fleet setup will be performed
# FLEET_TOKEN_NAME - token name for a token to be created
# KIBANA_HOST - actual kibana host [http://localhost:5601]
Expand Down Expand Up @@ -54,7 +55,11 @@ function enroll(){
fi
echo $apikey

./{{ .BeatName }} enroll ${KIBANA_HOST:-http://localhost:5601} $apikey -f
if [[ -n "${FLEET_ENROLL_INSECURE}" ]] && [[ ${FLEET_ENROLL_INSECURE} == 1 ]]; then
insecure_flag="--insecure"
fi

./{{ .BeatName }} enroll ${insecure_flag} ${KIBANA_HOST:-http://localhost:5601} $apikey -f
}

if [[ -n "${FLEET_SETUP}" ]] && [[ ${FLEET_SETUP} == 1 ]]; then setup; fi
Expand Down
6 changes: 6 additions & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,9 @@
- Add --staging option to enroll command {pull}20026[20026]
- Add `event.dataset` to all events {pull}20076[20076]
- Send datastreams fields {pull}20416[20416]
- Prepare packaging for endpoint and asc files {pull}20186[20186]
- Improved version CLI {pull}20359[20359]
- Enroll CLI now restarts running daemon {pull}20359[20359]
- Add restart CLI cmd {pull}20359[20359]
- Add new `synthetics/*` inputs to run Heartbeat {pull}20387[20387]
- Users of the Docker image can now pass `FLEET_ENROLL_INSECURE=1` to include the `--insecure` flag with the `elastic-agent enroll` command {issue}20312[20312] {pull}20713[20713]

0 comments on commit 350e8a0

Please sign in to comment.