xref: /freebsd/release/tools/openstack.conf (revision e63d20b70ee1dbee9b075f29de6f30cdcfe1abe1)
1#!/bin/sh
2#
3#
4
5# Set to a list of packages to install.
6export VM_EXTRA_PACKAGES="net/cloud-init devel/py-pbr devel/py-iso8601 \
7	net/py-eventlet net/py-netaddr comms/py-serial devel/py-six \
8	devel/py-babel net/py-oauth net/py-netifaces"
9
10# Set to a list of third-party software to enable in rc.conf(5).
11export VM_RC_LIST="cloudinit"
12
13export NOSWAP=YES
14
15vm_extra_pre_umount() {
16	#Enable sshd by default
17	echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
18
19	# Disable DNS lookups by default to make SSH connect quickly
20	echo 'UseDNS no' >> ${DESTDIR}/etc/ssh/sshd_config
21
22	# Allow root to ssh using keys
23	echo 'PermitRootLogin without-password' >> ${DESTDIR}/etc/ssh/sshd_config
24
25	# Disable sendmail
26	echo 'sendmail_enable="NO"' >> ${DESTDIR}/etc/rc.conf
27	echo 'sendmail_submit_enable="NO"' >> ${DESTDIR}/etc/rc.conf
28	echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf
29	echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf
30
31	# Enable DHCP for the OpenStack instance
32	echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
33
34	# Openstack wants sudo(8) usable by default without a password.
35	echo 'ALL ALL=(ALL) NOPASSWD:ALL' >> \
36		${DESTDIR}/usr/local/etc/sudoers.d/cloud-init
37
38	# The console is not interactive, so we might as well boot quickly.
39	echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf
40	echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf
41	echo 'boot_multicons="YES"' >> ${DESTDIR}/boot/loader.conf
42	echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf
43	echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf
44
45	# Reboot quickly, Don't wait at the panic screen
46	echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf
47	echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf
48	echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf
49
50	touch ${DESTDIR}/firstboot
51	return 0
52}
53