Ask Your Question

how to deploy bash scripts using puppet

asked 2014-09-26 16:11:59 -0500

umairch gravatar image

I want to ship a bash script along with some files to an agent managed by puppet master, the script will install some custom plugins, can puppet move/scp those files and bash script to the target nodes and then execute the script ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-09-27 10:21:49 -0500

llowder gravatar image

You'll want to use a file resource to place the files and then an exec to run the file.

Something like:

class mymodule::myklass {
  file {
      ensure => 'file',
      source => 'puppet:///modules/mymodule/',
      path => '/usr/local/bin/',
      owner => 'root'
      group => 'root'
      mode  => '0744', # Use 0700 if it is sensitive
      notify => Exec['run_my_script'],
  exec {
     command => '/usr/local/bin/',
     refreshonly => true,
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-09-26 16:11:59 -0500

Seen: 13,114 times

Last updated: Sep 27 '14