Project config reference

on this page

preflight.yml is the optional project configuration file. When it is missing, Preflight uses an empty config.

Location

Preflight looks for preflight.yml in the project directory. The project directory is the nearest directory, starting at the playbook’s directory and walking up, that contains preflight.yml, preflight.lock, actions/, or .git. If none is found, the playbook’s directory is used.

Top-level fields

FieldTypeDescription
projectstringProject name; available as vars.preflight.project
environmentstringEnvironment label, such as production; available as vars.preflight.environment
varsobjectProject variables, the lowest-precedence layer in the variable merge order
inventoryobjectHosts and groups; see Inventory reference
secretsobjectage-encrypted secret configuration

Unknown fields fail schema validation.

secrets

FieldTypeDescription
identitystringPath to the age identity file used for decryption, relative to the project directory unless absolute
recipientsstring[]age recipients used for encryption
entriesobjectSecret names mapped to entry objects

Each entries.<name> object:

FieldTypeRequiredDescription
filestringyesPath to the .age file, relative to the project directory unless absolute
typestringnoFree-form hint; Preflight does not read it

Secret references

A string value that is exactly secret:<name> resolves to the decrypted contents of entries.<name> when the value is used. It works in:

  • task and module parameters
  • inventory password, private_key, and private_key_passphrase, including in jump blocks

A file is decrypted only when a reference to it is resolved. Decryption fails with no secrets.identity configured in preflight.yml when identity is unset. See Manage secrets.

Example

yaml
project: natural-history-museum
environment: production

vars:
  content_root: "C:\\Exhibits\\content"

inventory:
  groups:
    lobby:
      vars:
        area: lobby
  hosts:
    - name: lobby-pc-01
      address: 192.168.1.10
      transport: winrm
      username: exhibit-admin
      password: secret:winrm-password
      groups: [lobby]

secrets:
  identity: .age/keys.txt
  recipients:
    - age1example...
  entries:
    winrm-password:
      file: secrets/winrm-password.age