On Tue, Jul 10, 2012 at 9:55 AM, Marshie8 <markmarsha...@gmail.com> wrote:
> Hi,
>
> I am new to Puppet.
>
> I need to monitor a file for changes on a server and if it does, copy it
> immediately to the clients. But it has permissions 640, and must retain
> these.
>
> Can anyone suggest a manifest for this?

Hi,

The idea behind puppet is that it centrally manages/controls your
node's configuration.  Given that as a premise, allowing your source
file to be changed on the server is going to quickly get things out of
control again, as puppet, as far as I know, can't monitor remote
server's files for changes to push out to other clients.

My suggestion would be to take a copy of the file as it is on your
server now, and place it under the control of puppet.  The following
simple manifest should do what you're after:

class server_file {

    file { "/destination/path/to/your/file":
        owner => owner,
        group => group,
        mode => 0640,
        source => "puppet:///files/server_file",
    }
}

In a default configuration of puppet on a UNIX-like OS, server_file
would be placed at /etc/puppet/files/server_file.

>From now on though, your admins/users are going to have to understand
that any changes to that file need to be made on the puppetmaster.

The above manifest also assumes that server_file is placed in the same
location on both clients and the server.

Hope this helps,

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to