setup: move linux setup to setup command

This commit is contained in:
tschettervictor
2025-11-27 17:21:08 -07:00
parent 1506bc59f5
commit 9f0b5f1cdb
5 changed files with 132 additions and 100 deletions

View File

@@ -3,8 +3,13 @@ Linux Jails
Bastille can create Linux jails using the ``debootstrap`` tool. When
attempting to create a Linux jail, Bastille will need to load some modules
as well as install the ``debootstrap`` package. When prompted, enter
'yes' when bootstrapping a Linux release.
as well as install the ``debootstrap`` package.
Getting Started
---------------
To get started, run ``bastille setup linux`` to load required modules
and install the ``debootstrap`` package.
Bootstrapping a Linux Release
-----------------------------

View File

@@ -101,12 +101,14 @@ Example
Tips
^^^^
See the documentation on templates for more information on how they work and
how you can create or customize your own. Templates are a powerful part of
Bastille and facilitate full container automation.
Notes
^^^^^
If you don't want to bother with git to use templates you can create them
manually on the Bastille system and apply them.
@@ -127,4 +129,4 @@ begin applying your template.
Options:
-p | --pkgbase Bootstrap using pkgbase (15.0-RELEASE and above).
-x | --debug Enable debug mode.
-x | --debug Enable debug mode.

View File

@@ -2,38 +2,42 @@ setup
=====
The ``setup`` sub-command attempts to automatically configure a host system for
Bastille jails. This allows you to configure networking, firewall, storage, vnet
and bridge options for a Bastille host with one command.
Bastille jails. This allows you to configure networking, firewall, storage, and
some additional options for a Bastille host with one command.
Options
-------
Below is a list of available options that can be used with the ``setup`` command.
.. code-block:: shell
The ``bridge`` options will attempt to configure a bridge interface for use with
bridged VNET (``-B``) jails.
ishmael ~ # bastille setup -h
Usage: bastille setup [option(s)] [bridge]
[loopback]
[pf|firewall]
[shared]
[vnet]
[storage]
Options:
-y | --yes Assume always yes on prompts.
-x | --debug Enable debug mode.
The ``linux`` options will attempt to configure your system to run
Linux (``-L|--linux``) jails. This will load some required kernel modules, and
add the to ``/boot/loader.conf``.
The ``loopback`` option will configure a loopback interface called ``bastille0``
that will be used as a default when not specifying an interface with the
``create`` command.
The ``netgraph`` option will attempt to configure your system to use ``netgraph``
as the network mode as opposed to the standard ``if_bridge`` mode.
The ``pf|firewall`` option will configure the pf firewall by enabling the service
and creating the default ``pf.conf`` file. Once this is done, you can use the
``rdr`` command to forward traffic into a jail.
The ``shared`` option will configure the interface you choose to also be used as
the default when not specifying an interface with the ``create`` command.
Please note. You CANNOT run both a loopback and a shared interface with Bastille.
Only one should be configured. If you configure one, it will disable the other.
The ``storage`` option will attempt to configure a pool and dataset for Bastille,
but only if ZFS in enabled on your system. Otherwise it will use UFS.
The ``vnet`` option will configure your system for use with VNET (``-V``) jails.
Limitations
-----------
The ``loopback`` option is the default, and is enough for most use cases. It is
simply an ``lo`` interface that jails will get linked to on creation. It is not
@@ -42,37 +46,28 @@ attached to any specific interface. This is the simplest networking option. The
is not specified during the ``create`` command. If an interface is specified,
these options have no effect. Instead, the specified interface will be used.
Please note. You CANNOT run both a loopback and a shared interface with Bastille.
Only one should be configured. If you configure one, it will disable the other.
The ``shared`` option is for cases where you want an actual interface to use with
Bastille as opposed to a loopback. Jails will be linked to the shared interface
on creation.
The ``pf|firewall`` option will configure the pf firewall by enabling the service
and creating the default ``pf.conf`` file. Once this is done, you can use the
``rdr`` command to forward traffic into a jail.
The ``storage`` option will attempt to configure a pool and dataset for Bastille,
but only if ZFS in enabled on your system. Otherwise it will use UFS.
The ``vnet`` option will configure your system for use with VNET ``-V`` jails.
The ``bridge`` options will attempt to configure a bridge interface for use with
bridged VNET ``-B`` jails.
Running ``bastille setup`` without any options will attempt to auto-configure the
``filesystem``, ``loopback``, ``firewall`` and ``storage`` options.
``loopback``, ``firewall`` and ``storage`` options.
.. code-block:: shell
ishmael ~ # bastille setup -h
Usage: bastille setup [option(s)] [bridge]
[filesystem]
[linux]
[loopback]
[netgraph]
[pf|firewall]
[shared]
[vnet]
[storage]
[vnet]
Options:
-y | --yes Assume always yes on prompts.
-x | --debug Enable debug mode.
-y | --yes Assume always yes on prompts.
-x | --debug Enable debug mode.