amotolani.cisco_fmc.network (1.1.5) — module

Create, Modify and Delete Cisco FMC network objects

Authors: Adelowo David (@amotolani)

Install collection

Install with ansible-galaxy collection install amotolani.cisco_fmc:==1.1.5


Add to requirements.yml

  collections:
    - name: amotolani.cisco_fmc
      version: 1.1.5

Description

Create, Modify and Delete Cisco FMC network objects.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a Network object
  amotolani.cisco_fmc.network:
    name: Sample-Network
    state: present
    network_type: Network
    fmc: .sample.com
    value: 11.22.32.0/24
    username: admin
    password: Cisco1234
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a FQDN object
  amotolani.cisco_fmc.network:
    name: Sample-FQDN
    state: present
    network_type: FQDN
    fmc: .sample.com
    value: sub.example.com
    username: admin
    password: Cisco1234
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Host objects from a loop
  amotolani.cisco_fmc.network:
    name: "{ { item.name } }"
    state: present
    network_type: Host
    fmc: cisco.sample.com
    value: "{{item.value}}"
    username: admin
    password: Cisco1234
  loop:
    - {name: Host1 , value: 10.10.10.2}
    - {name: Host2 , value: 10.10.10.3}
    - {name: Host2 , value: 10.10.10.4}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create Range objects from a loop and deploy changes to devices
  amotolani.cisco_fmc.network:
    name: "{ { item.name } }"
    state: present
    network_type: Range
    fmc: cisco.sample.com
    value: "{{item.value}}"
    username: admin
    password: Cisco1234
    auto_deploy: True
  loop:
    - {name: Range1 , value: 10.10.10.2-10.10.10.50}
    - {name: Range2 , value: 10.10.20.2-10.10.20.50}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete Host objects from a loop
  amotolani.cisco_fmc.network:
    name: "{ { item.name } }"
    state: absent
    network_type: Host
    fmc: cisco.sample.com
    value: "{{item.value}}"
    username: admin
    password: Cisco1234
  loop:
    - {name: Host1 , value: 20.10.10.2}
    - {name: Host2 , value: 20.10.10.3}
    - {name: Host2 , value: 20.10.10.4}

Inputs

    
fmc:
    description:
    - IP address or FQDN of Cisco FMC.
    required: true
    type: str

name:
    description:
    - The name of the cisco_fmc object to be created, modified or deleted.
    required: true
    type: str

state:
    description:
    - Whether to create/modify (C(present)), or remove (C(absent)) an object.
    required: true
    type: str

value:
    description:
    - FMC network object value.
    - For network type 'Host', accepted value is a valid IPv4 address (1.1.1.1)
    - For network type 'Range',  accepted value is a valid IPv4 address range (1.1.1.1-1.1.1.255)
    - For network type 'Network',  accepted value is valid IPv4 network address (1.1.1.0/24)
    - For network type 'FQDN', accepted value is a valid FQDN (www.example.com, sub.example.com,
      sub.sub.example.com) FTD does NOT accept wildcards
    required: true
    type: str

password:
    description:
    - Cisco FMC Password
    required: true
    type: str

username:
    description:
    - Cisco FMC Username
    - User should have sufficient permissions to modify objects
    required: true
    type: str

auto_deploy:
    default: false
    description:
    - Option to deploy configurations to deployable devices after changes
    required: false
    type: bool

description:
    description:
    - The description/comment of the cisco_fmc object.
    required: false
    type: str

network_type:
    description:
    - The network object type.
    - Allowed choices are Host, Network, Range, and FQDN
    - Use 'Host' to create, modify or delete an IP Host object
    - Use 'Range' to create, modify or delete an IP Address Range object
    - Use 'Network' to create, modify or delete a Network Address cisco_fmc object
    - Use 'FQDN' to create, modify or delete an FQDN Host object
    required: true
    type: str