Skip to content

Commit

Permalink
Cherry-pick to 7.9: Add FLEET_ENROLL_INSECURE env var to expose --ins…
Browse files Browse the repository at this point in the history
…ecure CLI option (#20713) (#20740)

* Add FLEET_ENROLL_INSECURE env var to expose --insecure CLI option (#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

* Fixing up CHANGELOG
  • Loading branch information
ycombinator authored Aug 24, 2020
1 parent 2ff1931 commit 1300905
Show file tree
Hide file tree
Showing 2 changed files with 7 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
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,4 @@
- Add --staging option to enroll command {pull}20026[20026]
- Add `event.dataset` to all events {pull}20076[20076]
- Send datastreams fields {pull}20416[20416]
- 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 1300905

Please sign in to comment.