4 LIBDIR="$(dirname "$PWD")"
6 source $LIBDIR/lib/common.sh
7 source $LIBDIR/lib/logging.sh
9 if [[ $EUID -ne 0 ]]; then
10 echo "This script must be run as root"
14 function install_essential_packages {
30 software-properties-common \
33 update-alternatives --install /usr/bin/python python /usr/bin/python3 1
34 update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
36 add-apt-repository -y ppa:longsleep/golang-backports
38 apt-get install golang-go -y
41 function install_ironic_packages {
46 python3-ironicclient \
47 python3-ironic-inspector-client \
50 python3-openstackclient \
55 if [ "$1" == "offline" ]; then
56 pip install --no-index
57 --find-links=file:$PIP_CACHE_DIR locat yq
66 function install_docker_packages {
67 apt-get remove docker \
78 software-properties-common
79 if [ "$1" != "offline" ]; then
80 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
82 "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
87 apt-get -y install docker-ce=18.06.0~ce~3-0~ubuntu
90 function install_podman_packages {
91 if [ "$1" != "offline" ]; then
92 add-apt-repository -y ppa:projectatomic/ppa
95 apt-get -y install podman
98 function install_kubernetes_packages {
99 if [ "$1" != "offline" ]; then
100 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
101 bash -c 'cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
102 deb https://apt.kubernetes.io/ kubernetes-xenial main
106 apt-get install -y kubelet=1.15.0-00 kubeadm=1.15.0-00 kubectl=1.15.0-00
107 apt-mark hold kubelet kubeadm kubectl
111 install_essential_packages
112 install_ironic_packages $1
114 #install_docker_packages $1
115 #install_podman_packages $1
116 #install_kubernetes_packages $1
119 if [ "$#" -eq 0 ]; then
121 elif [ "$1" == "-o" ]; then