title: copy shell script from puppet master to puppet agent and execute it on puppet agent
body: <p>I am trying to copy a shell script from puppet master to puppet client.</p>
  
  <p>This is my shell script on puppet master:</p>
  
  <pre><code>cat /etc/puppetlabs/code/environments/production/modules/mymodule/mybash.sh
  echo hi hello
  </code></pre>
  
  <p>I have copied the same shell script in <code>/home/myserver/mybash.sh</code> also.</p>
  
  <p>This is my site.pp file on puppet master:</p>
  
  <pre><code>cat /etc/puppetlabs/code/environments/production/manifests/site.pp
  
  notify{"Message : I am a message from puppet master": }
  
  class myfile {
    file { '/home/myserver/mybash.sh':
      mode   =&gt; '0755',
      owner  =&gt; 'root',
      source =&gt; 'puppet:///modules/mymodule/mybash.sh',
      notify =&gt; Exec['run_my_script'],
    }
    exec { 'run_my_script':
      command =&gt; '/home/npatel/mybash.sh',
    }
  }
  notify{"Message : new msg test": }
  </code></pre>
  
  <p>This is the output from puppet agent:</p>
  
  <pre><code>myclient:~$ sudo /opt/puppetlabs/bin/puppet agent --test
  Info: Using configured environment 'production'
  Info: Retrieving pluginfacts
  Info: Retrieving plugin
  Info: Caching catalog for myclient.test.com
  Info: Applying configuration version '1483393652'
  Notice: Message : I am a message from puppet master
  Notice: /Stage[main]/Main/Notify[Message : I am a message from puppet master]/message: defined 'message' as 'Message : I am a message from puppet master'
  Notice: Message : new msg test
  Notice: /Stage[main]/Main/Notify[Message : new msg test]/message: defined 'message' as 'Message : new msg test'
  Notice: Applied catalog in 0.20 seconds
  </code></pre>
  
  <p>It looks like only lines with <code>notify{"Message :</code> are getting executed on puppet agent, not the lines in between them.</p>
  
  <p>I don't see <code>mybash.sh</code> getting copied in <code>/home/my-client</code> path as mentioned in file section and there are no logs also to make sure that the file gets copied or not. </p>
  
  <p>Did I miss anything in the source value?</p>