examples/config/multi_config.rb
# -------------------------------------------------------------------
# define a function to do the configuration actions
# -------------------------------------------------------------------

define a function to do the configuration actions
define a function to do the configuration actions
def load_stuff( login )
  ndev = Netconf::SSH.new( login )
  $stdout.print "Connecting to device #{login[:target]} ... "
  ndev.open
  $stdout.puts "OK!"
  Junos::Ez::Provider( ndev )
  Junos::Ez::Config::Utils( ndev, :cfg )
  binding.pry
  ndev.close
end
def load_stuff ( login ) ndev = Netconf :: SSH . new ( login ) $stdout . print "Connecting to device #{login[:target]} ... " ndev . open $stdout . puts "OK!" Junos :: Ez :: Provider ( ndev ) Junos :: Ez :: Config :: Utils ( ndev , :cfg ) binding . pry ndev . close end
define a function to do the configuration actions
define a function to do the configuration actions
## create a NETCONF object to manage the device and open the connection ...
 # lock the candidate config 
 #    ndev.cfg.lock!
 # examples of loading ...
 #    ndev.cfg.load! :filename => 'load_sample.conf'
 #    ndev.cfg.load! :content => File.read( 'load_sample.conf' ), :format => :text
 #    ndev.cfg.load! :filename => 'load_sample.set'
 # check to see if the config is OK to commit
 #   ndev.cfg.commit?  
 # perform the commit
 #   ndev.cfg.commit!
 # unlock the config
 #   ndev.cfg.unlock!

login
<not_specific>