Install opsmill.infrahub
Ansible collection
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
- Build from source
- Build from source (Pull Request)
- Step 1:
git clone [email protected]:opsmill/infrahub-ansible.git
- Step 2:
cd ansible_modules
- Step 3:
ansible-galaxy collection build .
- 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).
Useful for testing changes in Pull Requests.
- Step 1:
git clone [email protected]:opsmill/infrahub-ansible.git
- Step 2:
cd ansible_modules
- Step 3:
git fetch origin pull/<pr #>/head:
- Step 4:
git checkout <branch_name>
- Step 5:
ansible-galaxy collection build .
- Step 6:
ansible-galaxy collection install opsmill-infrahub*.tar.gz
For detailed information on checking out pull requests locally, please refer to GitHub's Documentation.