Skip to content

Commit

Permalink
Merge pull request chvancooten#5 from nodauf/patch-1
Browse files Browse the repository at this point in the history
Update an hardcoded elasticsearch version with the variable
  • Loading branch information
chvancooten authored Apr 17, 2022
2 parents 6ce109f + cac53ed commit f7e8d7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Ansible/roles/elastic_server/files/fleet-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ POLICY_ID=$(curl -s -u "elastic:$PASSWORD" -H 'Content-Type: application/json' -
ELASTICSEARCH_VERSION=$(sudo /usr/share/elasticsearch/bin/elasticsearch -V | cut -d" " -f 2 | tr -d ",")
cd /tmp/
wget https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-$ELASTICSEARCH_VERSION-linux-x86_64.tar.gz
tar -xvf elastic-agent-8.1.0-linux-x86_64.tar.gz
tar -xvf elastic-agent-$ELASTICSEARCH_VERSION-linux-x86_64.tar.gz
cd elastic-agent-$ELASTICSEARCH_VERSION-linux-x86_64/
TOKEN=$(curl -k -u "elastic:$PASSWORD" -H 'kbn-xsrf: true' -s -X POST http://localhost/api/fleet/service-tokens | jq -r .value)

Expand All @@ -23,4 +23,4 @@ sudo ./elastic-agent install \
curl -k -u "elastic:$PASSWORD" -H 'kbn-xsrf: true' 'http://localhost/api/fleet/settings' \
-X 'PUT' \
-H 'Content-Type: application/json' \
--data-raw "{\"fleet_server_hosts\":[\"https://$IP_ADDRESS_SERVER:8220\"]}"
--data-raw "{\"fleet_server_hosts\":[\"https://$IP_ADDRESS_SERVER:8220\"]}"

0 comments on commit f7e8d7e

Please sign in to comment.