X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=env%2Fmetal3%2F01_install_package.sh;h=8b8c36fe14aa40cf047de36380f0062efe1fbce8;hb=43dbb5a2353606d1801f08dcf3e2fd06399843fb;hp=008bd2bf21bc5e4d01abc4b8f171e97d445561bc;hpb=2d1ee64f68cd36284bd180559e91b84a8c10dd3c;p=icn.git diff --git a/env/metal3/01_install_package.sh b/env/metal3/01_install_package.sh index 008bd2b..8b8c36f 100755 --- a/env/metal3/01_install_package.sh +++ b/env/metal3/01_install_package.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -ex +set -eux -o pipefail LIBDIR="$(dirname "$PWD")" @@ -12,26 +12,32 @@ if [[ $EUID -ne 0 ]]; then fi function install_essential_packages { + export DEBIAN_FRONTEND=noninteractive apt-get update apt-get -y install \ + ca-certificates \ crudini \ curl \ dnsmasq \ figlet \ + ipcalc \ nmap \ patch \ psmisc \ - python-pip \ - python-requests \ - python-setuptools \ + python3-pip \ + python3-requests \ + python3-setuptools \ vim \ wget \ git \ software-properties-common - add-apt-repository ppa:longsleep/golang-backports + update-alternatives --install /usr/bin/python python /usr/bin/python3 1 + update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1 + + add-apt-repository -y ppa:longsleep/golang-backports apt-get update - apt-get install golang-go + apt-get install golang-go -y } function install_ironic_packages { @@ -39,80 +45,28 @@ function install_ironic_packages { apt-get -y install \ jq \ nodejs \ - python-ironicclient \ - python-ironic-inspector-client \ - python-lxml \ - python-netaddr \ - python-openstackclient \ + python3-ironicclient \ + python3-ironic-inspector-client \ + python3-lxml \ + python3-netaddr \ + python3-openstackclient \ unzip \ - genisoimage - - if [ "$1" == "offline" ]; then - pip install --no-index - --find-links=file:$PIP_CACHE_DIR locat yq - return - fi + genisoimage \ + whois pip install \ lolcat \ yq } -function install_docker_packages { - apt-get remove docker \ - docker-engine \ - docker.io \ - containerd \ - runc - apt-get update - apt-get -y install \ - apt-transport-https \ - ca-certificates \ - curl \ - gnupg-agent \ - software-properties-common - if [ "$1" != "offline" ]; then - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) \ - stable" - apt-get update - fi - apt-get -y install docker-ce=18.06.0~ce~3-0~ubuntu -} - -function install_podman_packages { - if [ "$1" != "offline" ]; then - add-apt-repository -y ppa:projectatomic/ppa - apt-get update - fi - apt-get -y install podman -} - -function install_kubernetes_packages { - if [ "$1" != "offline" ]; then - curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - - bash -c 'cat </etc/apt/sources.list.d/kubernetes.list -deb https://apt.kubernetes.io/ kubernetes-xenial main -EOF' - apt-get update - fi - apt-get install -y kubelet=1.15.0-00 kubeadm=1.15.0-00 kubectl=1.15.0-00 - apt-mark hold kubelet kubeadm kubectl -} - install() { install_essential_packages - install_ironic_packages $1 - install_docker_packages $1 - install_podman_packages $1 - install_kubernetes_packages $1 + install_ironic_packages + install_kustomize + install_clusterctl + install_flux_cli + install_sops + install_emcoctl } -if ["$1" == "-o"]; then - install offline - exit 0 -fi - install