summaryrefslogtreecommitdiff
path: root/roles/installer/openbsd/autoinstall/templates/install.site.j2
blob: f4f9524d6770da5e7eb7d12dceeaa03a10cfcf91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

## TODO: enable this once we know how this works
## echo "Generating random root pasword"
## openssl rand -base64 24 | passwd root

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

{% if hostvars[hostname].ansible_port is defined %}
echo "Setting SSH port to {{ hostvars[hostname].ansible_port }}"
sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ hostvars[hostname].ansible_port }}/' -i /etc/ssh/sshd_config
{% endif %}

echo "Installing python"
pkg_add -Im python%3.7


rm /install.site