xref: /freebsd/release/tools/openstack.conf (revision 22cf89c938886d14f5796fc49f9f020c23ea8eaf)
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	rm -f ${DESTDIR}/etc/resolv.conf
39
40	# The console is not interactive, so we might as well boot quickly.
41	echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf
42	echo 'beastie_disable="YES"' >> ${DESTDIR}/boot/loader.conf
43	echo 'boot_multicons="YES"' >> ${DESTDIR}/boot/loader.conf
44	echo 'console="comconsole vidconsole"' >> ${DESTDIR}/boot/loader.conf
45	echo 'comconsole_speed="115200"' >> ${DESTDIR}/boot/loader.conf
46
47	# Reboot quickly, Don't wait at the panic screen
48	echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf
49	echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf
50	echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf
51
52	touch ${DESTDIR}/firstboot
53	return 0
54}
55