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