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,41 @@
---
# this block is responsible for loading the configuration on to the target
# device line by line from config model.
- name: load configuration onto target device
block:
- name: load configuration lines into target device
block:
- name: extract banners from configs if present
extract_banners:
config: "{{ ios_config_text }}"
register: result
- name: load configuration lines into target device except banner
cli_config:
config: "{{ result['config'] }}"
register: ios_config_output
- name: enter configuration mode
cli:
command: "configure terminal"
- name: load banner lines into target device
cli_command:
command: "{{ item }}"
sendonly: true
with_items: "{{ result['banners'] }}"
register: banner_config_output
- name: exit configuration mode
cli:
command: end
rescue:
- name: exit configuration mode
cli:
command: end
- name: set host failed
fail:
msg: "error loading configuration lines"
when: not ansible_check_mode