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
Pip
Debian/Ubuntu
macOS
Source
Install via Pip The recommended installation method for most users is pip, the Python package manager.
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
Install ansible-cmdb
Install ansible-cmdb using pip: sudo pip install ansible-cmdb
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.
Debian/Ubuntu Package Download the .deb package for your distribution from the GitHub Releases page .
Download package
Download the latest .deb package: wget https://github.com/fboender/ansible-cmdb/releases/download/VERSION/ansible-cmdb_VERSION_all.deb
Replace VERSION with the desired version number.
Install package
Install the package: sudo dpkg -i ansible-cmdb * .deb
Install dependencies
If there are dependency issues, run: Support for RPM and other package managers has been dropped. Please use the pip method instead for non-Debian distributions.
macOS (Homebrew) On macOS, the easiest installation method is using Homebrew:
Install Homebrew
If you don’t have Homebrew installed: /bin/bash -c "$( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install ansible-cmdb
Install ansible-cmdb: brew install ansible-cmdb
Install from Source For other systems or if you want to install from source:
Download source
Download and extract the source tarball: wget https://github.com/fboender/ansible-cmdb/releases/download/VERSION/ansible-cmdb-VERSION.tar.gz
tar -vxzf ansible-cmdb * .tar.gz
cd ansible-cmdb *
Install from Git Repository To install the latest development version from Git:
Clone repository
Clone the repository: git clone https://github.com/fboender/ansible-cmdb.git
cd ansible-cmdb
Install
Install using the build script: sudo bash -c ". build.sla && install"
Installing from Git gives you the latest development version, which may be unstable. For production use, install from a release.
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:
You should see output similar to:
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