As far as technique, assuming your myscript module (so in init.pp), you install 
the file using puppet and then run it:


class myscript {
  $filesource = "puppet:///modules/myscript"
  $script1 = '/usr/local/bin/myscript.sh'
  $script1source = "$filesource/myscript.sh"
  file { $script1:
    source => $script1source,
    mode => '755',
  }
  exec { $script1:
    refreshonly => true,
    require => File[$script1],
    subscribe => File[$script1],
  }
}

And then use that module in your node declarations:

node "myhost.com" {
 class { 'myscript': }
}


Read:

http://docs.puppetlabs.com/guides/language_guide.html
http://docs.puppetlabs.com/references/stable/type.html
http://docs.puppetlabs.com/puppet/2.7/reference/modules_fundamentals.html


(You could also package the script in a deb/rpm and install the package, or 
template the script, and so forth.)



On Thu, Jun 28, 2012 at 04:24:13AM -0700, kalaniS wrote:
> I'm a newbie to puppet and have been trying to execute a shell script
> residing in puppet master machine in a puppet agent, with no luck so
> far. Would appreciate any ideas on how to do this.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to