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