Automation

Scripting How-To: Use Puppet to distribute Junoscripts across multiple devices

By Elevate posted 08-08-2015 06:21

  

Distribute Puppet and Synchronize Junoscripts

 
You can use Puppet to distribute Junoscripts across multiple devices when grouped as Access Devices, Core Devices, and so on.
 

To distribute Junoscripts across multiple devices (on top of your existing and working Puppet environment):

  1. Create a directory classes/junoscripts under /etc/puppet.

    1	mkdir /etc/puppet/classes
    2	mkdir /etc/puppet/classes/junoscripts
  2. Create a file (for example, junoscripts.pp) including the following content:

    1	class junoscripts {
    2	    file { '/var/db/scripts/op/test.slax':
    3	        owner => puppet, group => wheel, mode => 0644,
    4	        source => "puppet:///files/junoscripts/test.slax",
    5	    }
    6	}
  3. Create a manifest (in this example, under /etc/puppet/manifest/nodes/ex2200.pp).

    1	import '/etc/puppet/classes/*.pp'
    2	 
    3	node "ex2200.test.com" {
    4	    include junoscripts
    5	}
  4. Create the /etc/puppet/files and /etc/puppet/files/junoscripts directories.
  5. Add the test.slax script (for test purposes, this can be any file) under the /etc/puppet/files/junoscripts directory.
  6. Edit /etc/puppet/fileserver.conf.

    1	[files]
    2	    path /etc/puppet/files
    3	    allow *
     
  7. Restart puppet master.
  8. Run Puppet agent on the Junos OS device.

Now, you should see test.slax on your Junos OS device under /var/db/scripts/op.

 

 


#Slax
#puppet
#How-To
#junoscript
#ScriptingHow-To
0 comments
0 views

Permalink