This is a tag created for questions which may fall under the automation category of Junos. Junos is the OS that runs on Juniper Networks routers.
Questions tagged [junos-automation]
58 questions
4
votes
2 answers
Executing vty commands in Juniper routers using PyEZ
I have a requirement where, a python script running in a Juniper router shell needs to execute some commands in vty console of the FPC. I cannot use vty c because it may not work properly in all platforms. However, I can use vty fpc0 and then…

Ghost
- 3,966
- 1
- 25
- 36
2
votes
0 answers
JunOS pyEz - Using 'serial' mode with Device class throws exceptions
I have been trying to use JunOS pyEZ to provision SRX which needs serial connection for initial configuration. Using the below mentioned code throws I/O exception:
from jnpr.junos import Device
from jnpr.junos.utils.config import Config
import…

shivintwrk
- 21
- 1
2
votes
1 answer
Gather a List of Configured IP Addresses
I want to pull out the lines of a Juniper config that assign an IPv6 address to an interface and save that output to a file.
The output I am after is generated with the command 'show configuration | display set| match "inet6 address" '
I'm building…

penfold1972
- 23
- 4
2
votes
2 answers
Unable to make a PyEZ connection: ConnectUnknownHostError
I am trying to use juniper_junos_facts from the Ansible Junos module to query some VM's that I provisioned using Vagrant. However I am getting the following error.
fatal: [r1]: FAILED! => {"changed": false, "msg": "Unable to make a PyEZ connection:…

Barry Keegan
- 81
- 2
- 9
2
votes
1 answer
python xpath returning empty list
I've read through a ton of threads on xpath & lxml, but I still seem to missing something with regards to the following xml.
I need to pull the 'rt-entry' item, along with the information under it.
I am trying the following in python:
from lxml…

Dayde
- 21
- 2
1
vote
1 answer
How to deal in AWS routing if we need to use a loopback interface in a EC2 instance
I am relatively new in AWS. I am trying some thing basic like this:
One Ubuntu instance is connected with a vSRX instance. Say Ubuntu instance eth1 ip is like 20.0.0.100 and vSRX corresponding interface ip is 20.0.0.101. Now I want to configure a…

Manas Pal
- 23
- 3
1
vote
1 answer
Ansible playbook ERROR! the role 'Juniper.junos' was not found in /home/
Hello im trying to run this playbook at with ansible and im getting this output every time
ERROR! the role 'Juniper.junos' was not found in…

pantelis athanasiou
- 11
- 2
1
vote
2 answers
How can I dynamically change the extra vars passed to playbook
I am trying to install a software on a set of hosts based on a condition. After executing the play I want to count on how many hosts the installation happened and how many were skipped.
I have tried declaring a variable inside the play before…

senthil
- 85
- 8
1
vote
1 answer
Regex including variable to match juniper srx output
New to programming with python as my first language.
I'm attempting to create a regex that would match 'lo0.0' or any other interface that presents in that position from the string below. I need the ip address '192.168.50.5' to be input as a…

Chromacy
- 21
- 4
1
vote
1 answer
Specific Targeting of Hosts Based on File Name
I am using ansible to send configuration ".set" files to a Junos OS devices using the "junos_install_config" module. I want to send specific files to specific hosts based on the names.
eg. I want to send the file "vMX1.set" to host vMX1, file…

Maurio
- 172
- 3
- 13
1
vote
0 answers
How to convert Juniper config backup file
We have a system that keeps a backup of the configuration of Juniper's devices
We need to load this file and transform it into a more readable format, such as XML or Json
Is it possible to do it with Python?
We found a way to do it in Ruby, but we…

SOSkr
- 21
- 6
1
vote
2 answers
Ansible raw module - how to handle the password prompt on SFTP/SCP?
For an ansible playbook to copy over a file on a target Junos machine, I need the raw module and sftp/scp to use.
The target machine (Junos) doesn't have python, so I have only raw module on the ansible side to run commands. And I've been trying…

SaifAhmed
- 19
- 1
- 3
1
vote
2 answers
Beginner Python Script to ssh into remote network device and run multiple commands
Please pardon me as I am a very new to any programming language. I have around 25 network devices combination of cisco, juniper, linux etc which i need to remotely access and run some basic cli commands to get the output. Individually SSHing in to…

Rutvij Brahmbhatt
- 13
- 5
1
vote
1 answer
Ansible 2.3 Core module junos_config - Failed "unable to open shell"
With Ansible 2.3 for the Core modules junos_config we get error "unable to open shell".
My playbook
25 tasks:
26 - name: Build configuration
27 template: src={{ playbook_dir }}/bgp.j2 dest={{ build }}/{{…

Nitin Kr
- 521
- 2
- 12
1
vote
2 answers
JUNOS PYEZ: Over write the Base config of a Device in SET command
I am writing the below code to push the base config to my device.
But it is merging the lines and not over writing.
Merging is still keeping the not required lines of Base config which is a problem to me
My config is in set command format .
Can…

Aryashree Mohapatra
- 25
- 5