Questions tagged [junos-automation]

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.

58 questions
0
votes
1 answer

JSNAPY: Is there a way to test on xpath node attributes

I am trying to determine how to test on the node attributes that junos occasionally uses. In this particular case, I want to find all BGP sessions that are down between 20w and 1y. The seconds value is contained in the node attribute, but I have not…
aelliott
  • 3
  • 2
0
votes
1 answer

Using Ansible to set new Junos OS User

Im trying to create a new user for my vMX router running Junos OS. The user needs to be a super-user with the following credentials: username: admin password: admin123 Doing this directly from the command line is easy, I simply change to edit mode…
Maurio
  • 172
  • 3
  • 13
0
votes
1 answer

What is the junos_install_config replacement module?

When using the junos_instal_config module from the Juniper.junos role for ansible in a playbook such as: --- - name: Send Set Files to Different Devices hosts: all roles: - Juniper.junos connection: local gather_facts: no tasks: -…
Maurio
  • 172
  • 3
  • 13
0
votes
2 answers

ansible junos UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0:

I was trying to get ansible for Junos router. While I execute the following code I get the following error: "An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnicodeDecodeError: 'utf8' codec can't…
sks
  • 11
  • 3
0
votes
0 answers

junos_l2_interface removes description, can it not?

junos_l2_interface module removes pre-set interface description and I would like it not to. Is there a way, or should I just redo this using junos_config module? Running Ansible 2.8.1 on JUNOS 14.1X53-D47.3 and using Juniper.junos role and…
0
votes
1 answer

Adding json data file to another common json file in Python

First of all I have search the similar issues of mine but none able to answer my question above. I hope you guys could advise me further. I' running a script to extract data from a list of network equipment and save the value onto json file for…
chenoi
  • 575
  • 3
  • 8
  • 30
0
votes
3 answers

Is there a way to convert juniper "json" or "xml" config to "set" or "show" config?

We use juniper hardware with junos version 15. In this version we can export our config as "json" or "xml" which we want to use to edit it with our automation tooling. Importing however is only possible in "set" or "show" format. Is there a tool to…
XenGi
  • 177
  • 2
  • 12
0
votes
2 answers

How do I get the mac-address table of a Juniper router using PyEZ? It throws an error when running

I have created a simple python script to get the vpls mac table from a rouer using an RPC command. Hower it throws an error when running. Does anybody know what I am doing wrong? root@ubuntu:~# cat vpls3.py #!/usr/bin/python3 from jnpr.junos import…
0
votes
1 answer

How to find when a JUNOS SRX firewall policy was last used

Is there any way we can figure out when a policy in JUNOS SRX firewalls was last used? I need to delete obsolete policies from the device. One way is to compare the hit-counts of two snapshots that were taken in a gap of x days. But I somewhat feel…
Prabir
  • 11
  • 4
0
votes
1 answer

Configuration Backup in JUNOS using TFTP

Is there any way to auto backup in Junos using TFTP like Cisco.. I can't find any specific documentation like this.. I have already did it in CISCO XR router by using those command: (config)#configuration commit auto-save filename…
0
votes
1 answer

Need help figuring out how to parse and extract port-mode a file?

I have a text file that contains the following information: interfaces { ge-2/0/0 { description "site1;;hostname1;ge-16/0/9;;;TRUST;"; unit 0 { family ethernet-switching { port-mode trunk; } } } ge-2/0/2 { …
ddevalco
  • 1,209
  • 10
  • 20
0
votes
2 answers

Junos Device CLI command giving wrong output when executed from python

When i try to execute Device.cli(....) command from python it gives me wrong output. What could be the issue? For example, if i execute below command on directly on Juniper Device CLI, it gives the correct output with match sadasd-sdasd-asdasd. show…
Srikanth Hugar
  • 385
  • 5
  • 22
0
votes
1 answer

How to filter the output- Junos Automation with Ansible

Purpose of my Code is to filter a specific Routing instance name from Configuration. My search is for a Routing Instance which is in configuration-> Routing -Instances->Instance -> name -> MY RI and all the lines which has MY RI I am okay with…
0
votes
1 answer

How to work around the inability to use a pipe in Junos_module command

I am trying to use ansible to automate some commands on a Juniper device. However the commands require me to use '|' (pipes). Reading over the Junos_command module documentation, pipes cannot be used. This module does NOT use the Junos CLI to…
user2883071
  • 960
  • 1
  • 20
  • 50
0
votes
1 answer

Junos_config not working anymore with ansible 2.5 python jsonDecoderError

Since we upgraded from ansible 2.4.3 to 2.5.0, Junos_config is failing with an error related to jasonDecoderError not found. After doing some research it seems that this attribute is only supported in python 3.5 and above. we are running python…
bundyboy
  • 13
  • 1
  • 4