This role is used to create a FreeBSD system which in turn may be used to host one or more jails. There are roles for jails which may be used in combination with this one to create a jailed www, db, or mail server. You may combine those jails as you wish to create a server that may host a bunch of WordPress installations,a single mail server, both, or anything else you want to run inside a jail.
This role is intent to be used with a fresh FreeBSD installation. There is a Vagrant Box with providers for VirtualBox and AWS.
This project contains a Vagrantfile
. Type
vagrant up
and you will enjoy a clean FreeBSD machine up and running. You may now create jails manually or use one of the other roles I created.
The servers external interface. Default: '{{ ansible_default_ipv4.interface }}'
.
The servers external ip address: Default: {{ ansible_default_ipv4.address }}'
.
The internal interface to which the jail's ip addresses will be added. Default: lo0
.
The servers internal ip address. This address is added to the internal interface
as well. Default: 10.1.0.1
.
The netmask for the jail's internal network. Used allow UDP pass pf in order to
reach syslogd. Default: '10.1.0.1/24'
.
Set this var to configure a private network interface for your host. The interface itself is configured via DHCP, but please make sure the variable host_net_priv_ip
is set to the values that is return from DHCP request. Default: ''
.
Set the ip to be used on private network interface. Even the interface configures itself via DHCP, still add the ip here that is returned from DHCP request. Default: ''
.
ZPool that should be used for /home
. Default: 'tank'
.
The FreeBSD version fetched/used by iocage, defaults to host release version. Default: {{ ansible_distribution_version }}-RELEASE
.
The name of the ZFS pool that should be used by iocage. Default: tank
.
If the ZFS pool used for iocage (jails home) is to be created, this specifies a space separated list of devices to use for the pool. There is no valid default. You have to specify, if the ZFS pool does not exist already. Default: None.
The name of the ZFS pool that should be used by /srv
folder. Default: tank
.
If the ZFS pool used for /srv
folder is to be created, this specifies a
space separated list of devices to use for the pool. There is no valid default.
You have to specify, if the ZFS pool does not exist already. Default: None.
The file that contains the public keys used to authenticate the sshd user.
Defaults to vagrant insecure public key: 'vagrant_pub_key'
The port sshd listens on. Default: 22
.
The user name allowed to access this server via ssh. Default: vagrant
.
This feature is only active, if the variable use_ssmtp
is set.
The password which is used to perform SMTP AUTH. No authentication if blank.
Default: ''
.
The user name which is used to authenticate against the SMTP server. No SMTP
AUTH if blank. Default: ''
.
System mails are forwarded to this mail host. See ssmtp man page for further information.
Default: 'mail.maildrop.cc'
.
The domain part of mails sent by ssmtp is rewritten using this variable. See ssmtp man page for further information.
Default: 'maildrop.cc'
.
System mails are forwarded to this account. See ssmtp man page for further information.
Default: 'freebsd-jail-host'
.
Use STARTTLS before starting SSL negotiation. Default: 'no'
.
Uses TLS when talking to SMTP server. Default: 'no'
.
Set this to yes
to use tarsnap for backup. Default: no
.
The keyfile to use to backup using tarsnap. See tarsnap documentation how to create one. Default: ''.
Create an additional repository in /usr/local/etc/pkg/repos/
using the URL and
public key provided by the following two variables. Default: no
.
The additional repositories public key used to verify downloaded packages. Default: None.
The additional repositories URL. Default: None.
Set to true
to forward log messages written by local syslog to a syslog server within a jail. Use host_syslogd_server
variable to specify ip address. Default: false
The ip address of the syslog server to forward messages to. Should be running within one of the hosted jails. Default: ``
The timezone the server is located. Default: 'Europe/Berlin'
.
None.
Playbook example with overridden defaults to use this role to setup a EC2 instance.
- hosts: all
become: true
roles:
- role: 'JoergFiedler.freebsd-jail-host'
If you like it or do have ideas to improve this project, please open an issue on Github. Thanks.