community_fabric.ansible.configs module – Fetch tables from IP Fabric.

Note

This module is part of the community_fabric.ansible collection (version 0.0.8).

To install it, use: ansible-galaxy collection install community_fabric.ansible.

To use it in a playbook, specify: community_fabric.ansible.configs.

Synopsis

  • Fetch tables from IP Fabric.

Parameters

Parameter

Comments

date

list / elements=string

Date of configuration to retrieve

dest

path / required

Absolute path where the file should be created to.

If src is a directory, the hostname will be used for the filename.

device

string

Hostname or IP of device

provider

dictionary / required

Information used to connect to IP Fabric via API

api_version

string

The version of the IP Fabric REST API.

auth

string / required

IP Fabric API auth token to be able to gather device information.

base_url

string / required

Url of the IP Fabric API

timeout

integer

Set HTTP Timeout

verify

boolean

Allows connection when SSL certificates are not valid. Set to false when certificated are not trusted.

Choices:

  • false

  • true ← (default)

sanitized

boolean

Mask passwords

Choices:

  • false

  • true

serial

string

Device serial number

Examples

- name: Get last configuration for L35ABC
  community_fabric.ansible.configs:
    provider:
      base_url: "https://demo1.eu.ipfabric.io/"
      auth: "{{ lookup('ansible.builtin.env', 'IPF_TOKEN')}}"
    device: L35ABC

- name: Get last configuration for L35ABC and save in a file
  community_fabric.ansible.configs:
    provider:
      base_url: "https://demo1.eu.ipfabric.io/"
      auth: "{{ lookup('ansible.builtin.env', 'IPF_TOKEN')}}"
    device: L35ABC
    dest: /tmp/config.txt

- name: Get previous configuration for L35ABC
  community_fabric.ansible.configs:
    provider:
      base_url: "https://demo1.eu.ipfabric.io/"
      auth: "{{ lookup('ansible.builtin.env', 'IPF_TOKEN')}}"
    device: L35ABC
    date: $prev # $last and $first supported

- name: Get configurations between specific dates for L35ABC
  community_fabric.ansible.configs:
    provider:
      base_url: "https://demo1.eu.ipfabric.io/"
      auth: "{{ lookup('ansible.builtin.env', 'IPF_TOKEN')}}"
    device: L35ABC
    date:
      - 11/22/ 1:30 #string or int supported
      - 1637629200

- name: Get all configurations for all devices
  community_fabric.ansible.configs:
    provider:
      base_url: "https://demo1.eu.ipfabric.io/"
      auth: "{{ lookup('ansible.builtin.env', 'IPF_TOKEN')}}"
    all: true

- name: Get all configurations for a L35ABC device
  community_fabric.ansible.configs:
    provider:
      base_url: "https://demo1.eu.ipfabric.io/"
      auth: "{{ lookup('ansible.builtin.env', 'IPF_TOKEN')}}"
    all: true
    device: L35ABC

Authors

  • Alex Gittings (@minitriga)