summaryrefslogtreecommitdiff
path: root/roles/installer/openbsd/autoinstall/templates/install.site.j2
blob: 1c2313c8c32214dd71de3e73800f696c9a47405d (plain) (blame)
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
#!/bin/sh

echo "Generating random root pasword"
usermod -p "$(openssl rand -base64 24 | encrypt)" root

echo "Installing SSH keys for root"
cat <<EOF > /root/.ssh/authorized_keys
{{ ssh_keys_root | join('\n') }}
EOF

{% if ansible_port is defined %}
echo "Setting SSH port to {{ ansible_port }}"
sed -e 's/^[ \t]*#*[ \t]*Port[ \t][ \t]*[0-9][0-9]*$/Port {{ ansible_port }}/' -i /etc/ssh/sshd_config
{% endif %}

echo "Installing python"
pkg_add -Im python3

echo "Disable sndiod service on first boot"
cat <<EOF >> /etc/rc.firsttime

rcctl disable sndiod
rcctl stop sndiod
EOF

rm /install.site