Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
Add specific role to build demo environment
Browse files Browse the repository at this point in the history
  • Loading branch information
TiTom committed Nov 17, 2016
1 parent 74a9b9d commit 47606ca
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 0 deletions.
8 changes: 8 additions & 0 deletions playbook-ztp-demo-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
### Setup local files to run demo in Paris office
- name: Populate ZTP repository to provide demo in France LAB
hosts: ansible-servers
connection: local
gather_facts: no
roles:
- {role: ztp-demo-lab-fr}
55 changes: 55 additions & 0 deletions roles/ztp-demo-lab-fr/files/FR-EX2200-110.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
version 12.3R3.4;
system {
host-name FR-EX2200-110;
time-zone Europe/Paris;
root-authentication {
encrypted-password "$1$vS28RTDq$z1zqSHDo9jKT.pKuv8VzR."; ## SECRET-DATA
}
name-server {
8.8.8.8;
}
services {
ssh {
root-login allow;
max-sessions-per-connection 32;
}
netconf {
ssh;
}
}
syslog {
host 172.26.34.142 {
any any;
}
file default-log-messages {
any any;
inactive: match "(requested 'commit' operation)|(copying configuration to juniper.save)|(commit complete)|ifAdminStatus|(FRU power)|(FRU removal)|(FRU insertion)|(link UP)|transitioned|Transferred|transfer-file|(license add)|(license delete)|(package -X update)|(package -X delete)|(FRU Online)|(FRU Offline)|(plugged in)|(unplugged)|cm_device|(Master Unchanged, Members Changed)|(Master Changed, Members Changed)|(Master Detected, Members Changed)|(vc add)|(vc delete)|(Master detected)|(Master changed)|(Backup detected)|(Backup changed)|(interface vcp-)\n ";
structured-data;
}
}
}
interfaces {
me0 {
unit 0 {
family inet {
address 10.73.1.110/24;
}
}
}
}
snmp {
trap-group space {
targets {
172.30.108.80;
172.30.108.78;
172.30.109.95;
172.30.109.80;
}
}
}
protocols {
rstp;
lldp {
interface all;
}
}
33 changes: 33 additions & 0 deletions roles/ztp-demo-lab-fr/files/hosts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
########################
## All Lab devices ##
########################
[all:children]
ztp-servers
ex
ansible-servers

########################
## Junos devices ##
########################
[ex]
FR-EX2200-110 junos_host=10.73.1.8 loopback_ip=100.0.0.1 mgmt_port=me0 mac_address=2c:6b:f5:3a:1d:7f

[ex:vars]
junos_version= "12.3R3.4"
junos_package= "jinstall-ex-2200-12.3R3.4-domestic.tgz"

########################
## ZTP devices ##
########################

[ztp-servers]
ztp01 ansible_host=10.73.1.254

[ztp-servers:vars]
ansible_connection=ssh
ansible_ssh_user=ansible
ansible_ssh_pass='password123'
ansible_sudo_pass='password123'

[ansible-servers]
ansible01 ansible_host=127.0.0.1
10 changes: 10 additions & 0 deletions roles/ztp-demo-lab-fr/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Move configuration for FR-EX2200-110 to junos_local
copy:
src: "{{ role_path }}/files/FR-EX2200-110.conf"
dest: "{{playbook_dir}}/{{ztp.path.junos_local}}/FR-EX2200-110.conf"

- name: Update inventory file
copy:
src: "{{ role_path }}/files/hosts.ini"
dest: "{{playbook_dir}}/hosts.ini"

0 comments on commit 47606ca

Please sign in to comment.