-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·40 lines (34 loc) · 1.01 KB
/
install.sh
File metadata and controls
executable file
·40 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -ex
REPO_DIR=$PWD
# Install Python3.7
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get update
sudo apt-get install python2.7 python2.7-dev python3.7 python3.7-dev python3-dev -y
sudo apt-get install python3-distutils -y
# Update bashrc
mkdir -p $HOME/bin
if [[ -z $(grep '^export PATH="$PATH:$HOME/bin"$' ~/.bashrc) ]]; then
echo 'export PATH="$PATH:$HOME/bin"' >> ~/.bashrc
fi
if [[ -z $(grep '^export PATH="$PATH:$HOME/.local/bin"$' ~/.bashrc) ]]; then
echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc
fi
source ~/.bashrc
# Install Pip
if [[ ! -f /usr/local/bin/pip3 ]]; then
cd ~/Downloads
if [[ ! -f ~/Downloads/get-pip.py ]]; then
wget https://bootstrap.pypa.io/get-pip.py
fi
python3 get-pip.py --user
cd $REPO_DIR
fi
# Install ansible
if [[ ! -f ~/.local/bin/ansible ]]; then
~/.local/bin/pip3 install ansible --user
export PATH="$PATH:$HOME/.local/bin"
fi
# Run playbook
~/.local/bin/ansible-playbook setup.yml --ask-become-pass
source ~/.bashrc