how to push archival config with Pyez or Napalm on Juniper.

200 views
Skip to first unread message

Tejas Mokashi

unread,
May 9, 2021, 12:11:36 PM5/9/21
to Junos Python EZ
Can anyone please guide me how to push archival config with Pyez or Napalm?
I am sending archival configuration to juniper device.
========================================
set system archival configuration transfer-on-commit
set system archival configuration archive-sites "scp://co...@10.10.10.10:/opt/config_backup" password "mypassword"
========================================

when entering these commands manually we need to answer the following prompt.
Are you sure you want to continue connecting (yes/no)?

The config backup to archival server(suppose 10.10.10.10) works fine as we add the ssh key for archival server to Juniper device's list of know hosts.

With napalm_configure it configures these commands but config backup to my archival server Fails.  May be it does not answer that prompt where device adds archival server's ssh key to known hosts.

Roger Wiklund

unread,
Jun 10, 2021, 9:39:52 PM6/10/21
to Junos Python EZ
Hi

You can add the ssh-known-hosts in Junos like this:

set security ssh-known-hosts host <host> <key-type> <key>

example:

set security ssh-known-hosts host 172.30.101.12 ecdsa-sha2-nistp256-key AAAAE2VjZHNhLXNjlaksjdfkljasdfklHAyNTYAAABBBG3H0XnceU+JAUnP/ao123434Sugyrm/P2lWDCszLasdfklfWKlybadhHB9WN0iI=

Regards
Roger

Rahul Kumar

unread,
Jun 11, 2021, 10:19:39 AM6/11/21
to Roger Wiklund, Junos Python EZ
Hi, 

Refer below link for examples and guide of how to set configuration on device using PyEZ. 
https://www.juniper.net/documentation/en_US/junos-pyez/topics/reference/general/junos-pyez-configuration-process-and-data-formats.html

Regards
Rahul kumar


From: junos-p...@googlegroups.com <junos-p...@googlegroups.com> on behalf of Roger Wiklund <roger....@gmail.com>
Sent: 11 June 2021 07:09
To: Junos Python EZ <junos-p...@googlegroups.com>
Subject: Re: how to push archival config with Pyez or Napalm on Juniper.
 

[External Email. Be cautious of content]

--
You received this message because you are subscribed to the Google Groups "Junos Python EZ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to junos-python-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/a66833cd-eef3-4126-bc24-9497c7b1696dn%40googlegroups.com.

Juniper Business Use Only

Reply all
Reply to author
Forward
0 new messages