Skip to content

Commit

Permalink
added code
Browse files Browse the repository at this point in the history
  • Loading branch information
devan555 committed May 22, 2024
1 parent 6453cd3 commit b2d6bff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/containerlab-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ 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
run: ansible-playbook containerlab_test/test_case1.yml -i containerlab_test/ansible-inventory.yml

- name: Destroy the Containerlab
if: always()
run: ansible-playbook ~/clab_files/ansible_files/02_destroy_clab.yml
run: ansible-playbook containerlab_test/destroy_containerlab.yml
17 changes: 17 additions & 0 deletions containerlab_test/destroy_containerlab.yml
Original file line number Diff line number Diff line change
@@ -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 }}"

0 comments on commit b2d6bff

Please sign in to comment.