Remove unused Makefile targets
[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     export DEBIAN_FRONTEND=noninteractive
16     apt-get update
17     apt-get -y install \
18     ca-certificates \
19     crudini \
20     curl \
21     figlet \
22     ipcalc \
23     nmap \
24     patch \
25     psmisc \
26     python3-pip \
27     python3-requests \
28     python3-setuptools \
29     vim \
30     wget \
31     git \
32     software-properties-common
33
34     update-alternatives --install /usr/bin/python python /usr/bin/python3 1
35     update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
36
37     add-apt-repository -y ppa:longsleep/golang-backports
38     apt-get update
39     apt-get install golang-go -y
40 }
41
42 function install_ironic_packages {
43     apt-get update
44     apt-get -y install \
45     jq \
46     nodejs \
47     python3-ironicclient \
48     python3-ironic-inspector-client \
49     python3-lxml \
50     python3-netaddr \
51     python3-openstackclient \
52     unzip \
53     genisoimage \
54     whois
55
56     pip install \
57     lolcat \
58     yq
59 }
60
61 install() {
62     install_essential_packages
63     install_ironic_packages
64     install_kustomize
65     install_clusterctl
66     install_flux_cli
67     install_sops
68     install_emcoctl
69 }
70
71 install