Skip to content
Snippets Groups Projects

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:

  • freebsd_install_local_mirror:

    • description:
      • local URL of install packages of FreeBSD
    • default: ""
  • 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

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

  1. execute system configuration (see configure)
  2. 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
  3. install native packages, if defined

configure

  1. execute basic system configuration
  2. set persistent kernel options
  3. set network configuration for IPv4 and IPv6
  4. restart network interfaces, if necessary
  5. set DNS configuration
  6. configure firewall (default: pf)
  7. set keymap and locale

answerfile

  1. generate answerfile and store it to system_answerfile_path

createcontainer

  1. check jail configuration
  2. create jail container, if its are not suppressed

configurecontainer

  1. configure jail container

installer

  1. install build dependencies
  2. 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

  1. create mirror path, if not exists
  2. download all FreeBSD release files of all given architectures and releases
  3. download all package files of given architectures and releases

registercontainer

  1. if container are used and ansible_connection has the value ssh, register container with sshjail
  2. if container are used and ansible_connection has the value local, register container with jail
  3. set container_host variable

upgrade

  1. 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
  2. if system_upgrade_states is not set 2.1 upgrade software of host system 2.2 upgrade software of container
  3. reboot system if necessary
  4. wait for system

_jaildevfs

  1. load jail container configurations
  2. set devfs rule in file /etc/defaults/devfs.rules
  3. restart devfs

_jailcreation

  1. install fstab for special jail container
  2. create jail container
  3. start jail container
  4. register jail container in inventory
  5. install software in jail container

_jailconfig

  1. collect and create jail container data

License

BSD-3-Clauses

Contributors