What this module does #
When you spin up an imaxe AMI, the first question is often the most basic one: what's inside? Which version of the operating system, which software is installed and in what version, which database sits behind it and which imaxe product has been deployed.
The info module answers all that in one go: it probes the system live and writes a clear, readable inventory to /etc/imaxe/info.yaml. That file gathers the operating system, the software and its versions, the database and the imaxe product, ready to view on screen or in JSON for automation.
The /etc/imaxe/info.yaml file is purely descriptive: names and versions. It never stores passwords, keys or tokens, so you can read it, copy it or attach it to a ticket with peace of mind.
Common tasks #
Choose what you want to do. Each recipe comes with the command already written — just copy it and hit Copy.
1
Generate the inventory
Probe the machine and write /etc/imaxe/info.yaml for the first time.
/etc/imaxe/info.yaml for the first time.Connect to your server over SSH with the ubuntu user.
Run create: it walks the system and writes the inventory to disk.
$ sudo imaxe info create/etc/imaxe/info.yaml file is written with the operating system, the software and its versions, the database and the imaxe product.2
See what I have installed
Show the already generated inventory on screen.
Read the inventory stored in /etc/imaxe/info.yaml:
$ imaxe info show3
Get the inventory in JSON
Structured output for scripts, monitoring or a centralized inventory.
Add --json to show to get the inventory in a machine-readable format:
$ imaxe info show --jsonWant to extract a single value? Combine it with jq, for example the operating system version:
$ imaxe info show --json | jq .osstdout, ready to pipe into jq, an inventory agent or your CMDB.4
Regenerate after a change
Update the inventory after installing or upgrading software.
The inventory is a snapshot of the system at the moment it was generated. If you've upgraded packages or changed the database, run create again to rewrite it with fresh data:
$ sudo imaxe info create
$ imaxe info show/etc/imaxe/info.yaml file reflects the real state of the machine again.The file reflects the system as it was when create ran. It doesn't update on its own: after any significant change to the software, run create again so that show stays true to reality.
Synopsis #
imaxe info <subcomando> [--json]The create subcommand requires root privileges (use sudo) because it writes to /etc/imaxe/. In contrast, show only reads the inventory and can run without sudo. Add --json to show to get machine-readable output suitable for scripting.
Subcommands #
| Subcommand | What it does | Relevant flags |
|---|---|---|
| create | Probes the system live and (re)writes the inventory to /etc/imaxe/info.yaml. | — |
| show | Shows the inventory stored in /etc/imaxe/info.yaml. | --json |
| help | Shows the module's help. | — |
Arguments and flags #
| Flag | Type | Default | Description |
|---|---|---|---|
| --json | bool | false | In show, emits the inventory as structured JSON on stdout, suitable for jq and automation. |
The info module takes no positional arguments: each subcommand operates on the system's own inventory.
Files and paths #
| Path | Contents |
|---|---|
| /etc/imaxe/info.yaml | AMI inventory: operating system, software and versions, database and imaxe product. Purely descriptive, no secrets. |
Example of info.yaml:
os:
name: Ubuntu
version: 22.04
software:
nginx: 1.18.0
php: 8.1
database:
engine: mysql
version: 8.0.36
product:
name: imaxe
version: 1.0.0Exit codes and logs #
Each run returns a code you can check with echo $? — handy for chaining in scripts:
show with no inventory: run create first.create without privileges to write to /etc/imaxe/.Troubleshooting #
| Symptom | Likely cause | Fix |
|---|---|---|
| show displays nothing or fails | The inventory hasn't been generated yet. | Run sudo imaxe info create and try show again. |
| create gives a permissions error | It was run without root and can't write to /etc/imaxe/. | Re-run it with sudo imaxe info create. |
| The inventory doesn't match reality | Software was installed or upgraded after it was generated. | Regenerate it with sudo imaxe info create: it's a point-in-time snapshot. |
The --json output isn't clean | --json was applied to a subcommand that doesn't support it. | --json only applies to show; use it as imaxe info show --json. |
Stuck with the Inventory module?
Write to us with the output of «imaxe <module> status --json» and we'll get back to you fast.