-
Notifications
You must be signed in to change notification settings - Fork 4
/
env_prep.sh
executable file
·46 lines (34 loc) · 1.4 KB
/
env_prep.sh
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
41
42
43
44
45
46
#!/usr/bin/env bash
# Change needsrestart to automatic
sudo sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf
# Add user local bin to path
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]
then
echo 'export PATH="$HOME/.local/bin:${PATH}"' >> $HOME/.bashrc
export PATH="$HOME/.local/bin:${PATH}"
fi
# Install required software packages
sudo apt-get update
sudo apt-get install -y gnupg software-properties-common vim
# Install the HashiCorp GPG key.
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg | gpg --enarmor
# Verify the key's fingerprint.
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
# Install Terraform
sudo apt-get update
sudo apt-get install -y terraform
# Install Python3
sudo apt-get install -y python3 python3-pip
echo "Upgrading pip and setuptools"
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
# Install Ansible
sudo apt-get install -y ansible
# Install sshpass
sudo apt-get install -y sshpass
# Install whois
sudo apt-get install -y whois
# Install Ansible Lib
ansible-galaxy collection install ansible.posix