]> WPIA git - infra.git/blob - manager/init-vm
fix: typo in init-vm script
[infra.git] / manager / init-vm
1 #!/bin/bash
2 source $1/config
3 ssh-copy-id -i vm-key $to
4 echo "Please add the following line to your sudoers file."
5 echo "%sudo ALL=(ALL) NOPASSWD:ALL"
6 read -rp 'Press Enter to visudo.' _
7 ssh -t -i vm-key $to "sudo visudo"
8 read -rp "The ssh-key to access the VM has been installed therefore ssh password authentication is not needed anymore. It's best to disable password authentication now in the sshd config file. Press Enter to edit the file." _
9 ssh -t -i vm-key $to "sudo -e /etc/ssh/sshd_config && sudo systemctl reload ssh"
10
11 # ci-speedup
12 read -rp 'We are done. Continue with additional setup to speed up CI builds? [y/N] ' prompt
13 if [[ $prompt == "y" ]]; then
14     ssh -i vm-key $to 'sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y git emacs-nox tmux curl puppet puppet-master lxc'
15     ssh -i vm-key $to 'sudo lxc-create -n base-image -t debian -- -r stretch --packages=gnupg2,puppet,lsb-release,debconf-utils'
16     ssh -i vm-key $to 'sudo rm -r /var/lib/lxc/base-image/rootfs/var/lib/apt/lists'
17 fi