]> git.phdru.name Git - ansible.git/blob - playbooks/debian/init-system.sh
Feat(debian/init-system): Start a shared connection with a password
[ansible.git] / playbooks / debian / init-system.sh
1 #! /bin/sh
2
3 if [ -z "$1" ]; then
4    echo "Usage: $0 host [...params...]" >&2
5    exit 1
6 fi
7
8 host="$1"
9 shift
10
11 ssh root@$host exec adduser phd
12 # Passwordless access isn't configured yet; use `ssh` connection sharing.
13 ssh phd@$host exit &&
14
15 cd "`dirname \"$0\"`" &&
16
17 # `sudo` isn't configured yet too; use `su` and ask for root password.
18 ansible-playbook ../init-system.yml "$@" -e hosts="$host" \
19    --become-method=su -K &&
20 ../run-roles debian/remove-systemd "$@" -e hosts="$host" &&
21 exec ansible-playbook ../init-system2.yml "$@" -e hosts="$host"