The Ansible collection includes a variety of Ansible content to help automate Cisco FMC via the FMC API
This collection has been tested against Cisco FMC version 6.3.0.
This collection has been tested against following Ansible versions: >=2.9.10,<2.11.
This collection relies heavily on the python fmcapi package to interact with the cisco fmc api
Run the below command to install via pip
pip3 install fmcapi
Name | Description |
---|---|
amotolani.cisco_fmc.acp_rule | FMC Access Rule Module |
amotolani.cisco_fmc.network | FMC Network Object Module |
amotolani.cisco_fmc.network_group | FMC Network Group Object Module |
amotolani.cisco_fmc.port | FMC Port Object Module |
amotolani.cisco_fmc.port_group | FMC Port Group Object Module |
amotolani.cisco_fmc.vlan | FMC VLAN Object Module |
amotolani.cisco_fmc.security_zone | FMC Security Zone Object Module |
Create a local ansible.cfg and specify the collections_paths configuration to locate the collections. See sample directory structure below
[defaults]
collections_paths = ./
ansible-galaxy collection install [email protected]:amotolani-dev/fmc_collections.git#/amotolani/cisco_fmc
ansible-galaxy collection install amotolani.cisco_fmc
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: amotolani.cisco_fmc
You can call modules by their Fully Qualified Collection Namespace (FQCN), such as amotolani.cisco_fmc.network
.
The following example task creates Host fmc objects from a loop and deploys this configuration, using the FQCN:
---
- name: Create Host objects from a loop
amotolani.cisco_fmc.network:
name: "{{item.name}}"
state: present
network_type: Host
fmc: ciscofmc.com
value: "{{item.value}}"
username: admin
password: Cisco1234
auto_deploy: true
loop:
- {name: Host1 , value: 10.10.10.2}
- {name: Host2 , value: 10.10.10.3}
- {name: Host2 , value: 10.10.10.4}
- Ansible Using collections for more details.
We are seeking contributions to help improve this collection. If you find problems, or a way to make it better, please open an issue or create a PR against the cisco_fmc collection repository.
This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.
Release notes are available here.
- Ansible network resources
- Ansible Collection overview
- Ansible User guide
- Ansible Developer guide
- Ansible code of conduct
GNU General Public License v3.0 or later.
See LICENSE to see the full text.