Description
This role configures and upgrades a FreeBSD system. Furthermore, it creates a mirror and installation media for this. For the creation of jail container it is possible to define special rules for devices to be seen by them. An example is:
function_packages:
- name: "example.service"
container: true
container_options:
exec.start: "/bin/sh /etc/rc"
exec.stop: "/bin/sh /etc/rc.shutdown"
exec.clean: yes
mount.devfs: yes
securelevel: "3"
devfs_ruleset: "5"
devfs_rules:
* "add path deviceXY unhide"
path: /var/jails/$name
The list devfs_rules contains a devfs rule that enables the deviceXY to the container. It is also nessecary to set the container option devfs_ruleset.
Requirement
User defined variables
- hostname: inventory hostname, needed for creation of answer file
- network
- keymap
- locale
Variables
-
freebsd_install_home_mirror:
- description:
- home URL of install packages of FreeBSD
- default: ftp://ftp.freebsd.org/pub/FreeBSD/releases
- description:
-
freebsd_install_local_mirror:
- description:
- local URL of install packages of FreeBSD
- default: ""
- description:
-
freebsd_kernel_options:
- description:
- This option is a list of tuples (name, value) of kernel options with their value.
- default: look at vars/main.yml
- description:
Connection plugins
- sshjail
Filter plugins
- sdm.common.ip_in_range
- sdm.common.regex_filter_list
Module
- jail
Roles
- package.pf
- package.packaging.pkgng
Tools
- git
- unarchive
Processes
main
- execute system configuration (see configure)
- if container are used 2.1 create container root directory 2.2 install jail.conf, if not exists 2.3 enable jail support 2.4 install container functions
- install native packages, if defined
configure
- execute basic system configuration
- set persistent kernel options
- set network configuration for IPv4 and IPv6
- restart network interfaces, if necessary
- set DNS configuration
- configure firewall (default: pf)
- set keymap and locale
answerfile
- generate answerfile and store it to system_answerfile_path
createcontainer
- check jail configuration
- create jail container, if its are not suppressed
configurecontainer
- configure jail container
installer
- install build dependencies
- build installer images for all given architectures and releases 2.1 create build directory 2.2 synchronise mfsBSD 2.3 set rc.conf entries 2.4 install unattended installer 2.5 copy ansible's public ssh key 2.6 install latest pkg-static 2.7 get installer files 2.8 create installer 2.9 register installer 2.10. cleanup installer image in build path
mirror
- create mirror path, if not exists
- download all FreeBSD release files of all given architectures and releases
- download all package files of given architectures and releases
registercontainer
- if container are used and ansible_connection has the value ssh, register container with sshjail
- if container are used and ansible_connection has the value local, register container with jail
- set container_host variable
upgrade
- if system_upgrade_states is set 1.1 identify corresponded host of development environment 1.2 upgrade software of host system 1.3 migrate jails for corresponded host of development environment
- if system_upgrade_states is not set 2.1 upgrade software of host system 2.2 upgrade software of container
- reboot system if necessary
- wait for system
_jaildevfs
- load jail container configurations
- set devfs rule in file /etc/defaults/devfs.rules
- restart devfs
_jailcreation
- install fstab for special jail container
- create jail container
- start jail container
- register jail container in inventory
- install software in jail container
_jailconfig
- collect and create jail container data
License
BSD-3-Clauses
Contributors
- Martin Pietsch (martin.pietsch@tu-dresden.de)