mirror of
https://github.com/dtzp555-max/aci-sim.git
synced 2026-07-19 09:46:33 +00:00
aci-sim is a stateful REST simulator of a 2-site Cisco ACI fabric (per-site APIC + ND/NDO management planes) — for testing ACI automation (Ansible cisco.aci / cisco.mso, aci-py, custom REST clients) and CI gates without real hardware. Highlights: APIC + NDO REST surface served from one in-memory MIT built from a declarative topology.yaml; port mode + sandbox (real per-device IPs on :443) run modes; LLDP/CDP neighbor visibility; NDO->APIC deploy mirror (multi-site templates materialize onto the target sites' APIC stores); real-APIC fvBD default attributes; file-backed state save/restore; an `aci-sim` CLI (validate/show/graph/run/new/init/lldp); and an 888-test suite. History squashed for the public release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
84 lines
2.5 KiB
YAML
84 lines
2.5 KiB
YAML
---
|
|
# teardown.yml — remove everything smoke.yml created (state=absent), in
|
|
# reverse dependency order. Deleting the tenant cascades its whole subtree
|
|
# in aci-sim (see docs/CONTRACT.md §11, MITStore.delete), so the
|
|
# later tasks are mostly redundant once the tenant is gone — they're kept
|
|
# here for clarity and so this playbook also works if you only want to
|
|
# tear down a single child object.
|
|
#
|
|
# ansible-playbook -i inventory.ini teardown.yml
|
|
#
|
|
- name: aci-sim teardown — remove smoke.yml objects
|
|
hosts: aci_sim
|
|
connection: local
|
|
gather_facts: false
|
|
|
|
vars:
|
|
aci_connection: &aci_connection
|
|
host: "{{ aci_hostname }}"
|
|
port: "{{ aci_port | default(8443) }}"
|
|
username: "{{ aci_username | default('admin') }}"
|
|
password: "{{ aci_password | default('cisco') }}"
|
|
validate_certs: "{{ aci_validate_certs | default(false) }}"
|
|
use_ssl: "{{ aci_use_ssl | default(true) }}"
|
|
|
|
smoke_tenant: SMOKE-TN1
|
|
smoke_vrf: SMOKE-VRF1
|
|
smoke_bd: SMOKE-BD1
|
|
smoke_ap: SMOKE-AP1
|
|
smoke_epg: SMOKE-EPG1
|
|
|
|
tasks:
|
|
- name: Remove EPG
|
|
cisco.aci.aci_epg:
|
|
<<: *aci_connection
|
|
tenant: "{{ smoke_tenant }}"
|
|
ap: "{{ smoke_ap }}"
|
|
epg: "{{ smoke_epg }}"
|
|
bd: "{{ smoke_bd }}"
|
|
state: absent
|
|
|
|
- name: Remove application profile
|
|
cisco.aci.aci_ap:
|
|
<<: *aci_connection
|
|
tenant: "{{ smoke_tenant }}"
|
|
ap: "{{ smoke_ap }}"
|
|
state: absent
|
|
|
|
- name: Remove bridge domain
|
|
cisco.aci.aci_bd:
|
|
<<: *aci_connection
|
|
tenant: "{{ smoke_tenant }}"
|
|
bd: "{{ smoke_bd }}"
|
|
vrf: "{{ smoke_vrf }}"
|
|
state: absent
|
|
|
|
- name: Remove VRF
|
|
cisco.aci.aci_vrf:
|
|
<<: *aci_connection
|
|
tenant: "{{ smoke_tenant }}"
|
|
vrf: "{{ smoke_vrf }}"
|
|
state: absent
|
|
|
|
- name: Remove tenant (cascades any remaining children)
|
|
cisco.aci.aci_tenant:
|
|
<<: *aci_connection
|
|
tenant: "{{ smoke_tenant }}"
|
|
state: absent
|
|
|
|
- name: Re-run tenant delete (idempotency check — must be changed=false)
|
|
cisco.aci.aci_tenant:
|
|
<<: *aci_connection
|
|
tenant: "{{ smoke_tenant }}"
|
|
state: absent
|
|
register: tenant_redelete
|
|
|
|
- name: Assert delete idempotency
|
|
ansible.builtin.assert:
|
|
that:
|
|
- not tenant_redelete.changed
|
|
fail_msg: >-
|
|
Deleting an already-absent tenant reported changed=true — DELETE
|
|
on a missing DN should be idempotent (see docs/CONTRACT.md §11).
|
|
success_msg: Delete idempotency check passed.
|