How to execute a script from the server

209 views
Skip to first unread message

mac01

unread,
Apr 3, 2012, 6:16:03 AM4/3/12
to puppet...@googlegroups.com

Hi,

How to only execute the script from the server instead of first copying the file & then executing the script from puppet ?

Thanks

Dan White

unread,
Apr 3, 2012, 8:37:32 AM4/3/12
to puppet...@googlegroups.com
But that is how it works.

file{
"/etc/puppet/scripts":
ensure => directory,
owner => "root",
group => "root",
mode => 70oo;

"/etc/puppet/scripts/checkUsers.bash":
owner => "root",
group => "root",
mode => 700,
source => "puppet:///modules/password/checkUsers.bash";
}

exec{ "/etc/puppet/scripts/checkUsers.bash":
user => "root",
logoutput => true,
require => File["/etc/puppet/scripts/checkUsers.bash"];
}

“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

Jeff McCune

unread,
Apr 3, 2012, 8:51:36 AM4/3/12
to puppet...@googlegroups.com
On Apr 3, 2012, at 6:16 AM, mac01 <smilemu...@gmail.com> wrote:

>
> Hi,
>
> How to only execute the script from the server instead of first copying the file & then executing the script from puppet ?

My answer depends on what you're trying accomplish. If you're trying
to get some data to fill in a resource, then a function is a good
choice. Generate() will likely do what you need. If you're trying to
manage something only on the server, I'd still model this as a file
and exec resource so it shows up in your reports and configuration
catalog.

Hope this helps.
-Jeff

Reply all
Reply to author
Forward
0 new messages