Hi, I am new to Puppet & just had installed Puppet master on Centos.And manging Linux & Windows nodes, now I would like to deploy and execute script on one of my Linux Box Remotely from Puppet Master. Appriciate your help. Pls. share steps to be followed for achieving above tast. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
JuanBrein
2013-Sep-16 12:53 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
Not hard at all... just use "file" resource to deploy the file and then "exec" to execute it: file{ "/path/to/my/script.sh" source => "puppet:///modules/${module_name}/script.sh", mode => 755, } ~> exec { "/path/to/my/script.sh" refreshonly => true, } The important bit here is the ~> . That means notify and require. It basically means it will notify the exec when the file is deployed and that puppet will push the file before trying to execute it. The refreshonly true will assure you that the script will be executed only if it is notified. Cheers Juan On Monday, September 16, 2013 7:25:59 AM UTC+1, Raju Patil wrote:> > Hi, > > I am new to Puppet & just had installed Puppet master on Centos.And > manging Linux & Windows nodes, now I would like to deploy and execute > script on one of my Linux Box Remotely from > Puppet Master. > > Appriciate your help. Pls. share steps to be followed for achieving above > tast. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Sep-16 14:38 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
On Monday, September 16, 2013 1:25:59 AM UTC-5, Raju Patil wrote:> > Hi, > > I am new to Puppet & just had installed Puppet master on Centos.And > manging Linux & Windows nodes, now I would like to deploy and execute > script on one of my Linux Box Remotely from > Puppet Master. > > Appriciate your help. Pls. share steps to be followed for achieving above > tast. >It depends on what you mean by that. If the target node is already registered with the master, and the agent is running on a regular schedule (whether as a standalone service or via a scheduler service such as cron), then you can proceed more or less as JuanBrein described. There are many variations, nuances, and caveats that he didn''t cover, but I''ll hold off on those for now, except this one: the approach described will result in the agent running the specified command as part of its next scheduled run. If instead you want to deploy and run your script right away, then you need something more or different, such as MCollective, for example. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Raju Patil
2013-Sep-19 13:01 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
JuanBrein, Can you pls.mention here, what activites do I have to perform on Master & nodes. Will be very helpful. Since I really dont know where this "file" resource to deploy the file and then "exec" to execute it: On Monday, 16 September 2013 18:23:18 UTC+5:30, JuanBrein wrote:> Not hard at all... > > just use "file" resource to deploy the file and then "exec" to execute it: > > file{ "/path/to/my/script.sh" > source => "puppet:///modules/${module_name}/script.sh", > mode => 755, > } ~> > > exec { "/path/to/my/script.sh" > refreshonly => true, > } > > The important bit here is the ~> . That means notify and require. It > basically means it will notify the exec when the file is deployed and that > puppet will push the file before trying to execute it. The refreshonly true > will assure you that the script will be executed only if it is notified. > > Cheers > > Juan > > On Monday, September 16, 2013 7:25:59 AM UTC+1, Raju Patil wrote: >> >> Hi, >> >> I am new to Puppet & just had installed Puppet master on Centos.And >> manging Linux & Windows nodes, now I would like to deploy and execute >> script on one of my Linux Box Remotely from >> Puppet Master. >> >> Appriciate your help. Pls. share steps to be followed for achieving above >> tast. >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Raju Patil
2013-Sep-19 13:03 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
On Thursday, 19 September 2013 18:31:21 UTC+5:30, Raju Patil wrote:> > JuanBrein, > > Can you pls.mention here, what activites do I have to perform on Master & > nodes. > > Will be very helpful. > > Since I really dont know where this > "file" resource to deploy the file and then "exec" to execute it: > > > > On Monday, 16 September 2013 18:23:18 UTC+5:30, JuanBrein wrote: > >> Not hard at all... >> >> just use "file" resource to deploy the file and then "exec" to execute it: >> >> file{ "/path/to/my/script.sh" >> source => "puppet:///modules/${module_name}/script.sh", >> mode => 755, >> } ~> >> >> exec { "/path/to/my/script.sh" >> refreshonly => true, >> } >> >> The important bit here is the ~> . That means notify and require. It >> basically means it will notify the exec when the file is deployed and that >> puppet will push the file before trying to execute it. The refreshonly true >> will assure you that the script will be executed only if it is notified. >> >> Cheers >> >> Juan >> >> On Monday, September 16, 2013 7:25:59 AM UTC+1, Raju Patil wrote: >>> >>> Hi, >>> >>> I am new to Puppet & just had installed Puppet master on Centos.And >>> manging Linux & Windows nodes, now I would like to deploy and execute >>> script on one of my Linux Box Remotely from >>> Puppet Master. >>> >>> Appriciate your help. Pls. share steps to be followed for achieving >>> above tast. >>> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Raju Patil
2013-Sep-30 12:58 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
I didnt see "file" resource to deploy the file and then "exec" option on Puppet master. Is there any plugin I have to installed on Master & then these two options will be visible on Puppet master dashboard. Or I have to do the changes in commandline. Seriousely, not aware which file to edit & move ahead. Need your help. On Thursday, 19 September 2013 18:31:21 UTC+5:30, Raju Patil wrote:> JuanBrein, > > Can you pls.mention here, what activites do I have to perform on Master & > nodes. > > Will be very helpful. > > Since I really dont know where this > "file" resource to deploy the file and then "exec" to execute it: > > > > On Monday, 16 September 2013 18:23:18 UTC+5:30, JuanBrein wrote: > >> Not hard at all... >> >> just use "file" resource to deploy the file and then "exec" to execute it: >> >> file{ "/path/to/my/script.sh" >> source => "puppet:///modules/${module_name}/script.sh", >> mode => 755, >> } ~> >> >> exec { "/path/to/my/script.sh" >> refreshonly => true, >> } >> >> The important bit here is the ~> . That means notify and require. It >> basically means it will notify the exec when the file is deployed and that >> puppet will push the file before trying to execute it. The refreshonly true >> will assure you that the script will be executed only if it is notified. >> >> Cheers >> >> Juan >> >> On Monday, September 16, 2013 7:25:59 AM UTC+1, Raju Patil wrote: >>> >>> Hi, >>> >>> I am new to Puppet & just had installed Puppet master on Centos.And >>> manging Linux & Windows nodes, now I would like to deploy and execute >>> script on one of my Linux Box Remotely from >>> Puppet Master. >>> >>> Appriciate your help. Pls. share steps to be followed for achieving >>> above tast. >>> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Rob Reynolds
2013-Sep-30 16:01 UTC
Re: [Puppet Users] Re: How to deploy & excecute script remotely
Raju, Being new to puppet, allow me to suggest the Learning Workshop - https://puppetlabs.com/learn. In conjunection with that, we have a set of free tutorials with a learning VM ( http://docs.puppetlabs.com/learning/ ) that I feel may help alleviate some of these questions. Give that a shot. Thanks! On Mon, Sep 30, 2013 at 7:58 AM, Raju Patil <rajiv.patil82@gmail.com> wrote:> I didnt see "file" resource to deploy the file and then "exec" option on > Puppet master. Is there any plugin I have to installed on Master & then > these two options will be > visible on Puppet master dashboard. Or I have to do the changes in > commandline. > Seriousely, not aware which file to edit & move ahead. Need your help. > > > > On Thursday, 19 September 2013 18:31:21 UTC+5:30, Raju Patil wrote: > >> JuanBrein, >> >> Can you pls.mention here, what activites do I have to perform on Master & >> nodes. >> >> Will be very helpful. >> >> Since I really dont know where this >> "file" resource to deploy the file and then "exec" to execute it: >> >> >> >> On Monday, 16 September 2013 18:23:18 UTC+5:30, JuanBrein wrote: >> >>> Not hard at all... >>> >>> just use "file" resource to deploy the file and then "exec" to execute >>> it: >>> >>> file{ "/path/to/my/script.sh" >>> source => "puppet:///modules/${module_**name}/script.sh", >>> mode => 755, >>> } ~> >>> >>> exec { "/path/to/my/script.sh" >>> refreshonly => true, >>> } >>> >>> The important bit here is the ~> . That means notify and require. It >>> basically means it will notify the exec when the file is deployed and that >>> puppet will push the file before trying to execute it. The refreshonly true >>> will assure you that the script will be executed only if it is notified. >>> >>> Cheers >>> >>> Juan >>> >>> On Monday, September 16, 2013 7:25:59 AM UTC+1, Raju Patil wrote: >>>> >>>> Hi, >>>> >>>> I am new to Puppet & just had installed Puppet master on Centos.And >>>> manging Linux & Windows nodes, now I would like to deploy and execute >>>> script on one of my Linux Box Remotely from >>>> Puppet Master. >>>> >>>> Appriciate your help. Pls. share steps to be followed for achieving >>>> above tast. >>>> >>> -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users. > For more options, visit https://groups.google.com/groups/opt_out. >-- Rob Reynolds Developer, Puppet Labs Join us at PuppetConf 2014, September 23-24 in San Francisco -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Oct-01 13:20 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
On Monday, September 30, 2013 7:58:16 AM UTC-5, Raju Patil wrote:> > I didnt see "file" resource to deploy the file and then "exec" option on > Puppet master. Is there any plugin I have to installed on Master & then > these two options will be > visible on Puppet master dashboard. Or I have to do the changes in > commandline. > Seriousely, not aware which file to edit & move ahead. Need your help. > >The File and Exec resource types are built-in to Puppet. And they are *resource types*, not classes, which is probably why you are not seeing them in Dashboard. I strongly recommend that you avoid Dashboard and similar products until you have a reasonable grasp of core Puppet. You do not need such products to use Puppet, and they will obscure some of the more fundamental details that you need to understand. You should start with the documentation: http://docs.puppetlabs.com/puppet/3/reference/. In particular, you should read the Puppet language reference, and you should at least skim the resource type reference in the "Generated References" section. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Raju Patil
2013-Oct-05 08:38 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
I have write the below script in puppet language on puppet master. Now wants to know that, I have to call this script to be excuted from puppet master on End points. How do I do that ? Class users { file { ''/opt/example.sh'': ensure => prsent, content => "#!/bin/sh\mkdir /opt/test123\n", mode => ''0755'', } exec { "create test123": command => ''/opt/example.sh'', creates => ''/opt/test123'', require => File[''/opt/example.sh''], Do I have to place this script on end point if yes...if I place it on end point how do I call it from Puppet Master What does this command do mco exec run script=''/opt/example/bin'' On Monday, 16 September 2013 11:55:59 UTC+5:30, Raju Patil wrote:> Hi, > > I am new to Puppet & just had installed Puppet master on Centos.And > manging Linux & Windows nodes, now I would like to deploy and execute > script on one of my Linux Box Remotely from > Puppet Master. > > Appriciate your help. Pls. share steps to be followed for achieving above > tast. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Oct-07 13:45 UTC
[Puppet Users] Re: How to deploy & excecute script remotely
On Saturday, October 5, 2013 3:38:55 AM UTC-5, Raju Patil wrote:> > I have write the below script in puppet language on puppet master. Now > wants to know that, I have to call this script to be excuted from puppet > master on End points. How do I do that ? >In the strictest sense, you *don''t* do that. Not at all, ever. It is very important for you to understand that one computer cannot run anything on another; all it can do is request that the remote computer run something itself. Even that requires that the remote machine run some kind of program to receive and act on such requests. In the most common Puppet usage paradigm, manifests such as the one you present reside on the master, and the Puppet agent periodically requests a compiled version (a catalog) from the master, which it (the agent) then ''applies'' to its machine. For this purpose, the agent can run as a local service (daemon) to automate the process on a regular schedule. Alternatively, it can be run periodically by a scheduler, such as cron, or on demand. In addition, if the agent is running as a local service, then it can be configured to listen for messages from the master that instruct it to immediately initiate a catalog cycle. That provides a mechanism by which the master can remotely induce the local machine to retrieve and apply its current catalog.> > Class users { > file { ''/opt/example.sh'': > ensure => prsent, > content => "#!/bin/sh\mkdir /opt/test123\n", > mode => ''0755'', > } > exec { "create test123": > command => ''/opt/example.sh'', > creates => ''/opt/test123'', > require => File[''/opt/example.sh''], > > > Do I have to place this script on end point if yes...if I place it on end > point how do I call it from Puppet Master >You do not need to place that manifest on the end point. If you do put it there, however, then you can apply it via a ''puppet apply'' command executed on that end point machine (as opposed to ''puppet agent'').> What does this command do > mco exec run script=''/opt/example/bin'' > >The ''mco'' command is part of the "Marionette Collective" (MCollective) system for cluster management. MCollective belongs to PuppetLabs and interoperates with Puppet, but it is not part of Puppet. Subject to several conditions and provisos, the command requests machines in the cluster to execute the named local command. This sort of approach can be employed to remotely trigger ''puppet agent'' or ''puppet apply'' commands, as long as the target machine is configured to support that. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.