FAI Environment Variables¶
This module provides access to the most important FAI environment
variables. If not running from FAI, most variables here are
None.
Hint
Many functions in the fai package depend on correct
environment settings defined here. If you want to run your scripts
without a full FAI process, make sure to define them properly.
- fai.env.ACTION: Union[fai.env.Action, str]¶
FAI action (
$FAI_ACTION)Well-known actions are mapped to elements of
Action. If running a custom action, this is simply astr.
- class fai.env.Action(value)¶
Enum of well-known FAI actions
- dirinstall¶
- install¶
- inventory¶
- softupdate¶
- sysinfo¶
- fai.env.CONFIG_SPACE: pathlib.Path¶
FAI config space (
$FAI)
- fai.env.LOGDIR: pathlib.Path¶
FAI log directory (
$LOGDIR)
- fai.env.ROOTCMD: Sequence[str]¶
Chroot command (
$ROOTCMD)The value from the environment is splitted with
shlex.splitand can thus be directly fed tosubprocess.run.
- fai.env.is_online()¶
Check if system installed/updated by FAI is online
Some tasks such as starting a service are only possible when FAI is run within the target system (i.e. FAI is doing a softupdate).
- Return type
- fai.env.target: pathlib.Path¶
FAI Installation target (
$target)