c39e1d1a61b1c1a7cae72c592f5de18a9e82001b
[icn.git] / deploy / metal3-vm / ubuntu_install_requirements.sh
1 #!/usr/bin/env bash
2 set -eux -o pipefail
3
4 # shellcheck disable=SC1091
5 source lib/logging.sh
6 # shellcheck disable=SC1091
7 source lib/common.sh
8
9 # Update to latest packages first
10 sudo apt -y update
11
12 # Install required packages
13
14 sudo apt -y install \
15   crudini \
16   curl \
17   dnsmasq \
18   figlet \
19   golang \
20   zlib1g-dev \
21   libssl1.0-dev \
22   nmap \
23   patch \
24   psmisc \
25   python3-pip \
26   wget
27
28 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
29 sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
30
31 # Install pyenv
32
33 if [[  $(cat ~/.bashrc) != *PYENV_ROOT* ]]; then
34   if ! [ -d "$HOME/.pyenv" ] ; then
35      git clone git://github.com/yyuu/pyenv.git ~/.pyenv
36   fi
37   # shellcheck disable=SC2016
38   # shellcheck disable=SC2129
39   echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
40   # shellcheck disable=SC2016
41   echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
42   # shellcheck disable=SC2016
43   echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.bashrc
44 fi
45
46 if [[ $PATH != *pyenv* ]]; then
47   export PYENV_ROOT="$HOME/.pyenv"
48   export PATH="$PYENV_ROOT/bin:$PATH"
49   if command -v pyenv 1>/dev/null 2>&1; then
50     eval "$(pyenv init -)"
51   fi
52 fi
53
54 # There are some packages which are newer in the tripleo repos
55
56 # Setup yarn and nodejs repositories
57 #sudo curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
58 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
59 #curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
60 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
61
62 # Add this repository to install Golang 1.12
63 sudo add-apt-repository -y ppa:longsleep/golang-backports
64
65 # Update some packages from new repos
66 sudo apt -y update
67
68 # make sure additional requirments are installed
69
70 ##No bind-utils. It is for host, nslookop,..., no need in ubuntu
71 sudo apt -y install \
72   jq \
73   libguestfs-tools \
74   nodejs \
75   qemu-kvm \
76   libvirt-bin libvirt-clients libvirt-dev \
77   golang-go \
78   unzip \
79   yarn \
80   genisoimage
81
82 # Install python packages not included as rpms
83 sudo pip install \
84   ansible==2.8.2 \
85   lolcat \
86   yq \
87   virtualbmc==1.6.0 \
88   python-ironicclient \
89   python-ironic-inspector-client \
90   lxml \
91   netaddr \
92   requests \
93   setuptools \
94   libvirt-python==5.7.0 \