Skip to content

Commit

Permalink
Update lab
Browse files Browse the repository at this point in the history
  • Loading branch information
knewell committed Apr 20, 2018
1 parent 3ef9ab4 commit bfd1a63
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 144 deletions.
4 changes: 2 additions & 2 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[defaults]
roles_path = /srv/ansible/roles
host_key_checking = False
library = /srv/ansible/lib/python3.5/site-packages/napalm_ansible-0.9.1-py3.5.egg/napalm_ansible/modules
action_plugins = /srv/ansible/lib/python3.5/site-packages/napalm_ansible-0.9.1-py3.5.egg/napalm_ansible/plugins/action
library = /srv/nslab-ansible/local/lib/python2.7/site-packages/napalm_ansible/modules
action_plugins = /srv/nslab-ansible/local/lib/python2.7/site-packages/napalm_ansible/plugins/action

[persistent_connection]
command_timeout=100
Expand Down
1 change: 0 additions & 1 deletion core-deploy.retry
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ansible-vmx1
ansible-vmx2
ansible-vmx3
ansible-vmx4
10 changes: 9 additions & 1 deletion core-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
## Second Play
- name: Generate Configuration for all routers
gather_facts: no
connection: local
# connection: local
hosts: all
tags: [ template ]
tasks:
- include_vars: "./nodes.yml"
- name: Get facts for napalm_os_version
napalm_get_facts:
hostname: "{{ ansible_host }}"
username: "{{ ansible_user }}"
dev_os: "{{ ansible_network_os }}"
optional_args:
key_file: "{{ ansible_ssh_private_key_file }}"
- name: create the directory for the configuration
file: path=core_config state=directory
run_once: true
Expand Down Expand Up @@ -46,5 +53,6 @@
key_file: "{{ ansible_ssh_private_key_file }}"
config_file: core_config/{{inventory_hostname}}-config.txt
commit_changes: "{{commit}}"
replace_config: "{{replace_config|default('0')}}"
diff_file: diff/{{inventory_hostname}}-diff.txt
when: "inventory_hostname in nodes.keys()"
3 changes: 2 additions & 1 deletion core_config/ansible-vmx1-config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

version 15.1F6.9
system {
host-name ansible-vmx1;
no-redirects;
Expand Down Expand Up @@ -75,7 +76,7 @@ interfaces {
description "OOB to MGMT Network";
unit 0 {
family inet {
address 10.39.0.41/24;
address 10.39.0.41/20;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion core_config/ansible-vmx2-config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

version 15.1F6.9
system {
host-name ansible-vmx2;
no-redirects;
Expand Down Expand Up @@ -62,7 +63,7 @@ interfaces {
description "OOB to MGMT Network";
unit 0 {
family inet {
address 10.39.0.42/24;
address 10.39.0.42/20;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion core_config/ansible-vmx3-config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

version 15.1F6.9
system {
host-name ansible-vmx3;
no-redirects;
Expand Down Expand Up @@ -62,7 +63,7 @@ interfaces {
description "OOB to MGMT Network";
unit 0 {
family inet {
address 10.39.0.43/24;
address 10.39.0.43/20;
}
}
}
Expand Down
136 changes: 0 additions & 136 deletions core_config/ansible-vmx4-config.txt

This file was deleted.

Empty file added diff/ansible-vmx1-diff.txt
Empty file.
Empty file added diff/ansible-vmx2-diff.txt
Empty file.
Empty file added diff/ansible-vmx3-diff.txt
Empty file.
3 changes: 3 additions & 0 deletions facts_napalm.retry
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ansible-vmx1
ansible-vmx2
ansible-vmx3
3 changes: 2 additions & 1 deletion facts_napalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
register: results

- name: Display facts
debug: var=results
debug:
var: "napalm_os_version"
1 change: 1 addition & 0 deletions junos/core.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### System configuration ######
**************************************************
#}
version {{napalm_os_version}}
system {
host-name {{inventory_hostname}};
no-redirects;
Expand Down

0 comments on commit bfd1a63

Please sign in to comment.