Skip to main content

Installation

Ansible-cmdb can be installed using pip, distribution packages, Homebrew, or from source. Choose the method that works best for your system.

Requirements

Ansible-cmdb requires Python v2.7+ or Python 3.0+.
In theory, ansible-cmdb should work on any system that can run Python, including BSD, Linux, Windows, Solaris, and macOS. In practice, it is developed on Ubuntu 16.04 and tested on the latest stable versions of Debian, Ubuntu, and CentOS.

Installation Methods

Install via Pip

The recommended installation method for most users is pip, the Python package manager.
1

Install pip

If you don’t have pip installed yet, install it for your distribution:
# Debian/Ubuntu
sudo apt-get install python3-pip

# RedHat/CentOS
sudo yum install python3-pip

# Fedora
sudo dnf install python3-pip
2

Install ansible-cmdb

Install ansible-cmdb using pip:
sudo pip install ansible-cmdb
3

Verify installation

Verify the installation:
ansible-cmdb --version

Upgrade via Pip

To upgrade to the latest version:
sudo pip install --upgrade ansible-cmdb
Using pip ensures you always have access to the latest version and makes upgrading simple.

Dependencies

Ansible-cmdb has the following Python dependencies (automatically installed when using pip):
  • mako - Template engine
  • pyyaml - YAML parser
  • ushlex - Shell-like lexer
  • jsonxs - JSONPath expressions
When installing via pip, all dependencies are installed automatically. When installing from source or distribution packages, you may need to install these dependencies manually.

Verifying Installation

After installation, verify that ansible-cmdb is working correctly:
ansible-cmdb --version
You should see output similar to:
ansible-cmdb v1.31
If the ansible-cmdb command is not found, check that the installation directory is in your PATH. The default installation locations are:
  • Pip: /usr/local/bin/ansible-cmdb
  • Debian/Ubuntu: /usr/bin/ansible-cmdb
  • Homebrew: /usr/local/bin/ansible-cmdb

Troubleshooting

Python Interpreter Issues

If you encounter issues with the Python interpreter, you can manually specify the Python binary and script path:
/opt/python3/bin/python /opt/ansible-cmdb/src/ansible-cmdb.py out/ > overview.html

Permission Denied

If you get permission errors, ensure you’re using sudo for system-wide installation, or use a virtual environment:
python3 -m venv ansible-cmdb-env
source ansible-cmdb-env/bin/activate
pip install ansible-cmdb

Next Steps

Quick Start

Learn how to generate your first host overview with a working example

Build docs developers (and LLMs) love