Inventory Overview

Understanding When Inventory Applies
If wanting to configure machines in Jet over SSH, there are two basic key concepts to understand -- Inventory and Playbooks.
If wanting to use Jet locally or in the future Planetary Scale mode, you only need to understand playbooks. In this section, we will assume you do want to deploy with SSH. If you want to learn Jet playbooks locally first, you can skip this section and come back later.
To review how to select different deployment modes using jetp subcommands, see Executing A Playbook.
Inventory tells jet (in SSH mode) which machines (arranged into Groups) we want to control or talk to.
There are two ways of defining inventory:
  1. 1.
    File-based inventory organizes lists of hosts into groups using YAML files on the filesystem. This structure is really best understood by having GitHub open in a new tab, so open up the link in example repo for examples when reading the chapter. File-based inventory is great for getting started and also for small development projects, though many users with production cloud configurations may not use it long term.
  2. 2.
    Dynamic inventory is commonly used with cloud systems and "external sources of truth". With these, jet calls an executable script (or scripts) that return JSON. These scripts ask the external source (such as a cloud provider) what machines there are to manage, so no inventory information has to be described manually -- this is important because in cloud cases, in particular, inventory is always changing.
No matter how we choose to load it, Inventory is defined by two types of objects in Jet -- Groups and Hosts, which are explained further in the upcoming sections.

Inventory Display

Inventory groups and hosts, as well as variables loaded from them, can be explored with the jetp CLI:
$ jetp show-inventory # shows the all group
$ jetp show-inventory --show-groups webservers
$ jetp show-inventory --show-hosts