summaryrefslogtreecommitdiff
path: root/extensions/molecule/_shared/lab_down.yml
blob: 92122a2c66a5d2de9737f0463ecf402fb435b4b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
---
- name: Destroy the scenario's containerlab topology
  hosts: localhost
  gather_facts: false
  vars:
    _topology: "{{ lookup('ansible.builtin.env', 'MOLECULE_SCENARIO_DIRECTORY') }}/topology.clab.yml"
  tasks:
    - name: Destroy lab
      ansible.builtin.command:
        cmd: containerlab destroy --cleanup --topo {{ _topology }}
      become: "{{ lookup('ansible.builtin.env', 'CLAB_BECOME', default='true') | bool }}"
      changed_when: true
      failed_when: false