Synopsis
<dir> argument specifies the directory containing Ansible fact files generated by ansible -m setup --tree <dir> all.
Command-Line Options
Directory containing Ansible fact files or fact cache files. This is the output directory from
ansible -m setup --tree <dir> command.Template to use for output generation. Can be a template name or a path to a custom template file.See Templates for available templates.
Path to Ansible inventory file, directory, or dynamic inventory script. Multiple inventories can be specified by separating them with commas (no spaces).This option enables ansible-cmdb to read:
- Host groups
- Host variables (including
dtap,comment,ext_id) - Group variables from
group_vars/andhost_vars/directories
Indicates that
<dir> contains fact-cache files instead of regular setup output files.When enabled, this option applies to all fact directories specified. You cannot mix fact-cache and regular setup directories.See Fact Caching for details.Parameters to pass to the template. Multiple parameters are separated by commas with no spaces.Format: See Templates for template-specific parameters.
key1=value1,key2=value2Example:Comma-separated list of column IDs to display in the output. Only applicable to templates that support columns (e.g.,
html_fancy, txt_table).Example:Path to a custom columns definition file. Allows you to define additional columns using jsonxs expressions or Mako templates.Only supported by
html_fancy and html_fancy_split templates.Example:Comma-separated list of column IDs to exclude from the output. Works with templates that support columns.Example:
Limit hosts included in the output using Ansible-style patterns. Supports:
all- all hosts- Individual hosts:
host1.example.com - Groups:
webservers - Inversion:
!groupname - Combinations:
all:!development:db1.example.com
-i option to be specified.See Limiting Hosts for details.Enable debug output. Shows detailed logging information during execution.
Suppress warning messages. Only error messages will be displayed.
Display the program version number and exit.
Show help message with all options and exit.
Basic Usage Examples
Advanced Examples
Multiple fact directories
You can specify multiple directories to overlay facts:- Override facts
- Add missing information
- Create manual host entries
- Add custom facts
Combining options
Notes
ansible-cmdb is a shell wrapper script that finds the correct Python binary and the ansible-cmdb.py script location. If it fails, you can manually specify: