misc changes

This commit is contained in:
Shane Peters
2019-01-15 13:59:01 -05:00
parent 41a9162c9c
commit 8b580286ba
7 changed files with 44 additions and 14 deletions

15
deploy
View File

@@ -9,16 +9,23 @@ log() {
}
if [ "$#" -lt 2 ]; then
log "usage: sudo ${0} ZFS_DATASET TAP_INTERFACE MGMT_INTERFACE"
log "usage: sudo ${0} <zfs_dataset> <tap_interface> <mgmt_interface> <prod|dev>"
exit 1
fi
set -x
export ZPOOL=${1}
export TAP=${2}
export MGMT=${3}
export PROD=${4}
export MGMT_IP=$(ip -o -4 a show ${MGMT} | awk '{print $4}' |cut -d '/' -f 1)
export LXC='/snap/bin/lxc'
source limits
if [ ! -z $PROD ]; then
source limits.prod
else
source limits.dev
fi
need_zfs() {
log "ZFS dataset \"${1}\" wasn't found. I suggest you create it and restart the deploy."
@@ -54,15 +61,13 @@ setup_lxd() {
ZPOOL=${1}
log "Deploying lxd on ${ZPOOL}."
lxd init --auto --storage-backend=zfs --storage-pool="${ZPOOL}"
${LXC} network create odinbr0 dns.domain="odin" ipv4.address="10.13.37.1/24" ipv4.nat=true ipv6.address=none
${LXC} network attach-profile odinbr0 default eth0
chown -R ${SUDO_USER}:${SUDO_USER} ${HOME}/.config/lxc
}
setup_containers() {
export BROFACE=${1}
# Order is important - start the pipeline (kafka) first, fsf is before bro because it bro submits files to it, etc...
# Order is important - start the pipeline (kafka) first, fsf is before ids because it bro submits files to it, etc...
export CONTAINERS="kafka elasticsearch logstash kibana fsf ids rita prometheus fouroneone"
for CON in ${CONTAINERS}; do