Skip to main content

Install opsmill.infrahub Ansible collection

info

This guide assumes you have basic knowledge of Ansible and its ecosystem. For more information on using Ansible, please refer to the official Ansible documentation.

Requirements

  • You must be running one of the two most recent releases of NetBox
  • A Infrahub API token when using modules (at least read-only for the inventory).
  • Python 3.10+
  • Python modules:
    • infrahub-sdk
  • Ansible 2.15+

Installation

Python modules and Ansible

pip install infrahub-sdk
pip install ansible

Infrahub Ansible collection

Before using this collection, you need to install it with the Ansible Galaxy command-line tool:

ansible-galaxy collection install opsmill.infrahub

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

collections:
- name: opsmill.infrahub

To upgrade the collection to the latest available version, run the following command:

ansible-galaxy collection install netbox.netbox --upgrade

You can also install a specific version of the collection, for example, if you need to downgrade. Use the following syntax to install a specific version:

ansible-galaxy collection install netbox.netbox:==VERSION

See using Ansible collections for more Collapsible.

Other installation options

Build from source

  1. Step 1: git clone [email protected]:opsmill/infrahub-ansible.git
  2. Step 2: cd ansible_modules
  3. Step 3: ansible-galaxy collection build .
  4. Step 4: ansible-galaxy collection install opsmill-infrahub*.tar.gz

For more Collapsible on building from source, please refer to [our dedicated documentation](link if available).