Remove stale offline option to scripts
[icn.git] / env / metal3 / 01_install_package.sh
1 #!/usr/bin/env bash
2 set -eux -o pipefail
3
4 LIBDIR="$(dirname "$PWD")"
5
6 source $LIBDIR/lib/common.sh
7 source $LIBDIR/lib/logging.sh
8
9 if [[ $EUID -ne 0 ]]; then
10     echo "This script must be run as root"
11     exit 1
12 fi
13
14 function install_essential_packages {
15     apt-get update
16     apt-get -y install \
17     crudini \
18     curl \
19     dnsmasq \
20     figlet \
21     nmap \
22     patch \
23     psmisc \
24     python3-pip \
25     python3-requests \
26     python3-setuptools \
27     vim \
28     wget \
29     git \
30     software-properties-common
31
32     update-alternatives --install /usr/bin/python python /usr/bin/python3 1
33     update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
34
35     add-apt-repository -y ppa:longsleep/golang-backports
36     apt-get update
37     apt-get install golang-go -y
38 }
39
40 function install_ironic_packages {
41     apt-get update
42     apt-get -y install \
43     jq \
44     nodejs \
45     python3-ironicclient \
46     python3-ironic-inspector-client \
47     python3-lxml \
48     python3-netaddr \
49     python3-openstackclient \
50     unzip \
51     genisoimage \
52     whois
53
54     pip install \
55     lolcat \
56     yq
57 }
58
59 install() {
60     install_essential_packages
61     install_ironic_packages
62 }
63
64 install