Skip to content

Usage

Jetpack runs a playbook against a target: either the local machine or remote hosts over SSH.

Tasks receive automatic names from their operations and resources. Add an optional name: to explain a task’s purpose.

Local execution

Run a playbook against the machine you’re on:

jetpack local --playbook bootstrap.yml

jetpack local also supports a convention-based bootstrap flow from the current working directory — see Playbooks.

SSH execution

Run a playbook against hosts defined in an inventory, over SSH:

jetpack ssh --playbook site.yml --inventory production

Pull mode

Fetch a playbook from a URL or git repository and run it, useful for bootstrapping:

jetpack pull --url https://example.com/playbook.tar.gz
jetpack pull --playbook playbook.yml -i inventory_dir

Check before you apply

Validate a run without changing anything:

CommandWhat it checks
jetpack syntax-check --playbook site.ymlThe playbook parses and references are valid.
jetpack inventory-check --inventory productionThe inventory tree loads and resolves.
jetpack full-check --playbook site.yml --inventory productionBoth, together.

Inspect inventory

List the hosts and groups an inventory resolves to:

jetpack show-inventory --inventory production --show-hosts

Common flags

  • -i / --inventory — inventory path (may be given multiple times; later paths overlay earlier ones — see Inventory).
  • -p / --playbook — playbook file.
  • --limit-hosts / --limit-groups — restrict the run.
  • -v / -vv / -vvv — increase verbosity.
  • --extra-vars / -e — inject variables on the command line.

Run jetpack --help for the full list.

Next