cisco.aci.aci_bd_subnet – Manage Subnets (fv:Subnet)¶
Note
This plugin is part of the cisco.aci collection (version 2.0.0).
To install it use: ansible-galaxy collection install cisco.aci
.
To use it in a playbook, specify: cisco.aci.aci_bd_subnet
.
Parameters¶
Notes¶
Note
The
gateway
parameter is the root key used to access the Subnet (not name), so thegateway
is required when the state isabsent
orpresent
.The
tenant
andbd
used must exist before using this module in your playbook. The cisco.aci.aci_tenant module and cisco.aci.aci_bd can be used for these.
See Also¶
See also
- cisco.aci.aci_bd
The official documentation on the cisco.aci.aci_bd module.
- cisco.aci.aci_tenant
The official documentation on the cisco.aci.aci_tenant module.
- APIC Management Information Model reference
More information about the internal APIC class fv:Subnet.
- Cisco ACI Guide
Detailed information on how to manage your ACI infrastructure using Ansible.
- Developing Cisco ACI modules
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples¶
- name: Create a tenant
cisco.aci.aci_tenant:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: present
delegate_to: localhost
- name: Create a bridge domain
cisco.aci.aci_bd:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
state: present
delegate_to: localhost
- name: Create a subnet
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
state: present
delegate_to: localhost
- name: Create a subnet with options
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
subnet_name: sql
gateway: 10.1.2.1
mask: 23
description: SQL Servers
scope: public
route_profile_l3_out: corp
route_profile: corp_route_profile
state: present
delegate_to: localhost
- name: Update a subnets scope to private and shared
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
scope: [private, shared]
state: present
delegate_to: localhost
- name: Get all subnets
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
- name: Get all subnets of specific gateway in specified tenant
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
gateway: 10.1.1.1
mask: 24
state: query
delegate_to: localhost
register: query_result
- name: Get specific subnet
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
state: query
delegate_to: localhost
register: query_result
- name: Delete a subnet
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
state: absent
delegate_to: localhost
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Jacob McGill (@jmcgill298)