Adding Netbox
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
connection: local
|
||||
roles:
|
||||
- vlan_expand
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: import dependency role for test
|
||||
import_role:
|
||||
name: "{{ role_path.split('/tests/vlan_expand/vlan_expand')[0] }}"
|
||||
|
||||
- name: vlan_expand test
|
||||
import_tasks: vlan_expand.yaml
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
- name: vlan_expand single vlan
|
||||
debug:
|
||||
msg: "{{ 'vlan1' | vlan_expand }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "'1' in result.msg"
|
||||
|
||||
- name: vlan_expand range of vlans1
|
||||
debug:
|
||||
msg: "{{ 'vlan1-5' | vlan_expand }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "'1' in result.msg"
|
||||
- "'2' in result.msg"
|
||||
- "'3' in result.msg"
|
||||
- "'4' in result.msg"
|
||||
- "'5' in result.msg"
|
||||
|
||||
- name: vlan_expand range of vlans2
|
||||
debug:
|
||||
msg: "{{ 'vlan1,3-5,7' | vlan_expand }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "'1' in result.msg"
|
||||
- "'3' in result.msg"
|
||||
- "'4' in result.msg"
|
||||
- "'5' in result.msg"
|
||||
- "'7' in result.msg"
|
||||
Reference in New Issue
Block a user