ansible_lxd_tests/Playbooks/local_lxd/scripts/01-Setup.bash

45 lines
776 B
Bash
Raw Normal View History

2022-09-15 00:18:11 -03:00
#!/bin/bash
set -x
aptGet() {
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
apt-get -fuy autoremove
apt-get clean
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install \
openssh-server \
cron \
--yes
}
sshConfig() {
ufw allow ssh
}
## Admin user
U="admin"
P="admin"
G="sudo"
UUID="420"
UHOME="/home/admin"
adduser \
--disabled-login \
--home "$UHOME" \
--ingroup "$G" \
--uid "$UUID" \
--quiet "$U"
echo "$U:$P" | chpasswd
getent group "$G"
#echo "$U ALL=(ALL) /02-Virtualmin.sh" | EDITOR='tee -a' visudo
#chmod 775 /*.sh && chown $U:$G /*.sh
aptGet
sshConfig
sh /02-Virtualmin.sh --verbose --minimal --force --hostname virtualmin.container.test