diff --git a/.github/workflows/containerlab-actions.yml b/.github/workflows/containerlab-actions.yml index c9ee517..07a5fad 100644 --- a/.github/workflows/containerlab-actions.yml +++ b/.github/workflows/containerlab-actions.yml @@ -9,7 +9,6 @@ jobs: # - run: echo "REPO_NAME=${{ github.event.repository.name }}" - name: Deploy devices in Containerlab and run the Playbook - # run: ansible-playbook ~/clab_files/ansible_files/01_run_clab.yml -i containerlab_test/ansible-inventory.yml run: ansible-playbook containerlab_test/deploy_containerlab.yml -i containerlab_test/ansible-inventory.yml - name: Run the testcase1 on the Containerlab Devices @@ -17,4 +16,4 @@ jobs: - name: Destroy the Containerlab if: always() - run: ansible-playbook ~/clab_files/ansible_files/02_destroy_clab.yml \ No newline at end of file + run: ansible-playbook containerlab_test/destroy_containerlab.yml \ No newline at end of file diff --git a/containerlab_test/destroy_containerlab.yml b/containerlab_test/destroy_containerlab.yml new file mode 100644 index 0000000..b03c7aa --- /dev/null +++ b/containerlab_test/destroy_containerlab.yml @@ -0,0 +1,17 @@ +--- +- name: Run CLAB + hosts: localhost + become: yes + become_method: sudo + gather_facts: false + vars: + ansible_become_password: password + topology_file: /home/user1/actions-runner/_work/ceos_config/ceos_config/containerlab_test/topology.clab.yaml + tasks: + - name: Execute destroy + local_action: command sudo containerlab destroy --topo {{ topology_file }} + become: yes + register: destroy_out + ignore_errors: true + + - debug: msg="{{ destroy_out }}" \ No newline at end of file