-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.tftpl
23 lines (20 loc) · 997 Bytes
/
init.tftpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
prep_system() {
DEBIAN_FRONTEND=noninteractive apt-get -qqy update
DEBIAN_FRONTEND=noninteractive apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' upgrade
DEBIAN_FRONTEND=noninteractive apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install linux-headers-$(uname -r)
build-essential python3-pip curl wget unzip jq resolvconf
}
add_logging() {
echo "deb https://repo.logdna.com stable main" | tee /etc/apt/sources.list.d/logdna.list
wget -O- https://repo.logdna.com/logdna.gpg | apt-key add -
DEBIAN_FRONTEND=noninteractive apt-get -qqy update
DEBIAN_FRONTEND=noninteractive apt-get install logdna-agent < "/dev/null"
logdna-agent -k ${logdna_ingestion_key}
logdna-agent -s LOGDNA_APIHOST=api.${region}.logging.cloud.ibm.com
logdna-agent -t ${vpc_tag}
logdna-agent -t "hostname:`hostname -s`"
systemctl enable --now logdna-agent
}
prep_system
add_logging