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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.