Adding Netbox

This commit is contained in:
Patrick Toal
2019-05-06 00:34:45 -04:00
parent 832502de34
commit 6e2205a046
278 changed files with 12767 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
---
template_path: "{{ role_path }}/templates"

View File

@@ -0,0 +1,14 @@
---
- name: generate config
debug:
msg: "{{ lookup('json_template', '{{ template_path }}/config.json') }}"
register: result
- assert:
that:
- "'GigabitEthernet0/0' in result.msg"
- "'config' in result['msg']['GigabitEthernet0/0']"
- "'Configured by Ansible' in result['msg']['GigabitEthernet0/0']['config']['description']"
- "result['msg']['GigabitEthernet0/0']['config']['mtu'] == '1500'"
- "'iGbE' in result['msg']['GigabitEthernet0/0']['config']['type']"
- "'GigabitEthernet0/0' in result['msg']['GigabitEthernet0/0']['config']['name']"

View File

@@ -0,0 +1,7 @@
---
- name: import dependency role for test
import_role:
name: "{{ role_path.split('/tests/json_template/json_template')[0] }}"
- name: json_template lookup plugin test
import_tasks: json_lookup.yaml

View File

@@ -0,0 +1,26 @@
{
"object": [
{
"object": [
{
"value": "GigabitEthernet0/0",
"key": "name"
},
{
"value": "iGbE",
"key": "type"
},
{
"value": "1500",
"key": "mtu"
},
{
"value": "Configured by Ansible",
"key": "description"
}
],
"key": "config"
}
],
"key": "GigabitEthernet0/0"
}

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
connection: local
roles:
- json_template