IPFabric inventory for Ansible.
This collection is currently heavily inspired by the great work over at the Netbox Ansible collection.
The axiansdeveloper.ipfabric collection only supports IPFabric versions of 3.7 and greater due to support for API tokens.
- IPFabric 3.7+
- Python 3.6+
- Ansible 2.9+
- IPFabric read-only token for
inventory
Run the following command to install the axiansdeveloper.ipfabric collection:
ansible-galaxy collection install axiansdeveloper.ipfabric
# ipfabric_inventory.yml file in YAML format
# Example command line: ansible-inventory -v --list -i ipfabric_inventory.yml
---
plugin: axiansdeveloper.ipfabric.inventory
api_endpoint: "https://192.168.3.1/api/v1"
validate_certs: True
token: 1234567890abcdefghijklmnop
# group_by allows for grouping based on different items such as sites, vendors etc
group_by:
- sites
Modules can be used to interact with IPFabric. There are currently two modules that allow for interaction:
- snapshot_facts - returns information about snapshots
- snapshot - Create, delete and manipulate snapshots in IPFabric
- name: "Test IPFabric modules"
connection: local
hosts: localhost
gather_facts: False
tasks:
- name: Create a New Ipfabric Snapshot
axiansdeveloper.ipfabric.snapshot_facts:
ipfabric:
host: https://192.168.3.1
token: 1234567890abcdefghijklmnop
validate_certs: false
register: snapshot
- name: debug
debug:
var: result
- name: Create a New Ipfabric Snapshot
axiansdeveloper.ipfabric.snapshot:
ipfabric:
host: https://192.168.3.1
token: 1234567890abcdefghijklmnop
validate_certs: false