Configuration

config.yaml

The default configuration file for homer is expected to be found at /etc/homer/config.yaml. Its path can be changed in the CLI via the command-line switch -c/--config PATH. A commented example configuration is available in the source code at doc/examples/config.yaml and included here below:

base_paths:
  # Base path of public configuration.
  public: /path/to/public-config-and-templates-root
  # [optional] Base path of private configuration.
  private: /path/to/private-config-and-templates-root
  # Base path for the output files generated on the 'generate' action. The directory will be cleaned from all '*.out' files.
  output: /path/where/to/generate/output/files

# Netbox configuration [optional]
netbox:
  # Netbox URL
  url: https://netbox.example.com:443
  # Netbox token
  token: token_value
  # Inventory parmeters. [optional]
  # If defined the list of devices will be gathered from Netbox, not from the config file. In this case the
  # configuration file is used only to populate the device configuration data to be used when computing the generated
  # configuration for the device.
  inventory:
    # Device roles to include in the selection. Values must match Netbox's slug values.
    device_roles:
      - roleA
      - roleB
    # Device statuses to include in the selection. Values must match Netbox's statuses.
    device_statuses:
      - Active
      - Staged
  # Custom external plugin to mangle Netbox data. [optional]
  # An optional custom external plugin in the form of a Python module, that will be dynamically loaded, if
  # configured, to allow to make custom mangling of the Netbox data.
  # The module must be in the Python PATH and define a NetboxDeviceDataPlugin class that inherits from
  # homer.netbox.BaseNetboxDeviceData.
  plugin: external.module

# Capirca configuration [optional]
capirca:
  disabled: true # Optional - disable Capirca acl generation, overriding device definitions (default=false)
  netbox_definitons: false # Optional - use Netbox as the source for Capirca network definitions (default=true)

# Transpors configuration. [optional]
transports:
  username: MrFoobar  # Username to use for the SSH connection, default to system user. [optional]
  ssh_config: ~/.ssh/config.homer  # Path to a dedicated SSH config for Homer. [optional]
  # The global timeout in seconds to use for all devices. Defaults to 30s [optional]
  # It can be overriden per device in the devices.yaml configuration file.
  timeout: 30
  # JunOS specific configuration. [optional]
  # See: https://junos-pyez.readthedocs.io/en/2.3.0/jnpr.junos.utils.html#jnpr.junos.utils.config.Config.load
  junos:
    ignore_warning:
      - statement must contain additional statements
      - statement has no contents

The example file is also shipped, depending on the installation method, to:

  • $VENV_PATH/share/doc/homer/examples/config.yaml when installed in a Python virtualenv via pip.

  • /usr/local/share/doc/homer/examples/config.yaml when installed globally via pip.

  • /usr/share/doc/homer/examples/config.yaml when installed via the Debian package.