Skip to content

Instantly share code, notes, and snippets.

@janstarke
Last active October 5, 2020 10:18
Show Gist options
  • Save janstarke/e265d86f467f2238abf22db86624291f to your computer and use it in GitHub Desktop.
Save janstarke/e265d86f467f2238abf22db86624291f to your computer and use it in GitHub Desktop.
provisioning files for vagrant
#!/bin/bash
MYIP=$1
function configure() {
sed -i "s~#*$2:.*~$2: $3~" $1
}
CFG=/etc/elasticsearch/elasticsearch.yml
export DEBIAN_FRONTEND=noninteractive
apt install --yes elasticsearch
# do not enable prodution mode yet, because this requires a cluster
#configure $CFG 'network.host' '["$MYIP", "127.0.0.1", "[::1]"]'
#configure $CFG 'discovery.seed_hosts' '["127.0.0.1", "[::1]"]'
#configure $CFG 'cluster.initial_master_nodes' '["127.0.0.1"]'
systemctl start elasticsearch
systemctl enable elasticsearch
gpasswd -a vagrant elasticsearch
#!/bin/bash
MYIP=$1
function configure() {
sed -i "s~#*$2:.*~$2: $3~" $1
}
CFG=/etc/kibana/kibana.yml
export DEBIAN_FRONTEND=noninteractive
apt install --yes kibana
#configure $CFG server.host '"$MYIP"'
#configure $CFG elasticsearch.hosts '["http://$MYIP:9200"]'
systemctl enable kibana
systemctl start kibana
gpasswd -a vagrant kibana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment