Hi John,

On Thu, Jan 17, 2013 at 6:56 AM, jcbollinger <[email protected]> wrote:
>
>
> On Wednesday, January 16, 2013 3:35:46 PM UTC-6, Josh Cooper wrote:
>>
>> Hi Alex,
>>
>> On Wed, Jan 16, 2013 at 12:49 PM, phundisk <[email protected]>
>> wrote:
>> > I am noticing some very odd behavior with my puppet server and a windows
>> > client.
>> >
>> > For my puppet server I have a module setup similar to this below...
>> > Please
>> > note, I am not setting any permission on this file.
>> > file { "C:\\directory\\file.dll":
>> >                 ensure => 'present',
>> >                 source => "puppet:///modules/aaa/file.dll",
>> > }
>> >
>> > The actual permissions in the unix filesystem is set to 644
>> >
>> > When I apply this to my Windows client, the puppet agent will change the
>> > mode of the file already on the server to 0644, which is not what I
>> > would
>> > expect puppet to do.  I would expect since it is already there, it would
>> > not
>> > even care about the permissions.
>> >
>> > I know this is taking the UNIX filesystem permissions because I chmod'd
>> > the
>> > file on the filesystem to 0777 and when running puppet on Windows, it
>> > took
>> > the new permissions.
>> >
>> > This becomes problematic because I am using puppet environments with an
>> > SVN
>> > checkout system.  Every time I update svn checkouts, it defaults to
>> > 0644.
>> > Does anyone know if this is expected behavior or ways around this?
>>
>> This is "expected" in that windows agents emulate current *nix agent
>> behavior. With that said there are issues with the current behavior in
>> general. Currently, *nix agents will attempt to apply the remote
>> uid/gid to the local system, which may not be what you would expect.
>> See http://projects.puppetlabs.com/issues/5240.
>
>
>
> What I would expect on both Unix and Windows is that if the target file
> already exists and the resource declaration does not specify a mode, then
> the current mode will not be changed.  It is not a managed property.

Good point. I would expect the behavior you describe, but that's not
what I'm seeing.

Here's my module's init.pp:

class dism {
  file { "${systemdrive}/tmp/file.dll":
    ensure => 'present',
    source => "puppet:///modules/dism/file.dll",
  }
}

On the master:

# ls -la file.dll
-rwxr--r-- 1 root root 15 Jan 17 10:17 file.dll

When using a Mac agent, the mode is indeed changed, but not the owner
or group. This seems to consistent as far back as 0.25.4:

$ puppetd --version
0.25.4
$ puppetd --test --debug
debug: /Stage[main]/Dism/File[/tmp/file.dll]/checksum: Initializing
checksum hash
debug: /Stage[main]/Dism/File[/tmp/file.dll]: Creating checksum
{md5}0c7169d609a64c22bd07e1e3a3b38a9f
debug: /Stage[main]/Dism/File[/tmp/file.dll]: Changing mode
debug: /Stage[main]/Dism/File[/tmp/file.dll]: 1 change(s)
notice: /Stage[main]/Dism/File[/tmp/file.dll]/mode: mode changed '644' to '744'

> The
> same applies to uid/gid.  This is distinguished from the case of issue 5240,
> which is about the uid/gid to apply to a File resource if the target file is
> initially absent.
>
> Is the Windows client indeed emulating the Unix one here?  In other words,
> are they both buggy, or is it just the Windows client?

So it seems they are consistent. Did puppet used to behave differently
in earlier versions?

Josh

--
Josh Cooper
Developer, Puppet Labs

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

Reply via email to