Skip to content

axiansdeveloper/ansible-ipfabric

Repository files navigation

Code style: black Release

Ansible Collection - axiansdeveloper.ipfabric

IPFabric inventory for Ansible.

This collection is currently heavily inspired by the great work over at the Netbox Ansible collection.

Requirements

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

Installing axiansdeveloper.ipfabric

Run the following command to install the axiansdeveloper.ipfabric collection:

ansible-galaxy collection install axiansdeveloper.ipfabric

Inventory

# 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

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

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages