-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitial_install.sh
More file actions
executable file
·57 lines (36 loc) · 1.77 KB
/
initial_install.sh
File metadata and controls
executable file
·57 lines (36 loc) · 1.77 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
###
### This script should be run as a regular user, all tasks requiring root permissions will
### use "become: true". Some tasks e.g. during the installation of homebrew
### should be run as a regular user, they will fail when run as root
###
set -euo pipefail
ansible_password_file="${HOME}/.ansible_becomepass_temp"
touch ${ansible_password_file}
chmod go-rwx ${ansible_password_file}
function cleanup {
rm ${ansible_password_file}
}
trap cleanup EXIT
echo "Enter sudo password to be used by ansible for privileged tasks"
# set empty IFS so read will read until the newline
IFS= read -sr password
echo ${password} > $ansible_password_file
eval $(ssh-agent)
ssh-add
# set up debian testing repos
# as well as all other repos we need
ansible-playbook playbooks/repo_setup.yaml --become-password-file ${ansible_password_file} -i inventory.yaml
source /etc/os-release
if [[ "$PRETTY_NAME" == "Debian" ]]; then
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt-get autoremove
fi
# install all desired software
ansible-playbook playbooks/software_installation.yaml --become-password-file ${ansible_password_file} -i inventory.yaml
ansible-playbook playbooks/script_installation.yaml --become-password-file ${ansible_password_file} -i inventory.yaml
ansible-playbook playbooks/config.yaml --become-password-file ${ansible_password_file} -i inventory.yaml
ansible-playbook playbooks/fonts.yaml --become-password-file ${ansible_password_file} -i inventory.yaml
ansible-playbook playbooks/storage.yaml --become-password-file ${ansible_password_file} -i inventory.yaml
echo "INFO: Note, that the homedir_setup role needs a valid SSH key in the ssh-agent"
ansible-playbook playbooks/homedir_setup.yaml --become-password-file ${ansible_password_file} -i inventory.yaml