On Wednesday, September 3, 2014 3:49:22 PM UTC-5, Balasubramaniam Natarajan 
wrote:
>
>
>
>
> On Tue, Sep 2, 2014 at 10:08 PM, Wil Cooley <[email protected] 
> <javascript:>> wrote:
>
>>
>>  No, recurse is only useful for copying directory to directory.
>>
>> What are you going to accomplish? Copying a source directory of symlinks 
>> as their targets? If so, there's a separate parameter for that.
>>
>> Wil
>>
>>
>>  I have a separate UMASK defined. 
>
> If I follow [2] puppet changes all the directory permission under 
> /home/bala/ even if they are not included under puppet:///files/home/bala/ 
> to be synced (i.e /home/bala/Documents /home/bala/Downloads 
> /home/bala/Desktop) gets their permission changed.  
>
>

It sounds like you may want recurse => 'remote' instead of recurse => true; 
see 
https://docs.puppetlabs.com/references/latest/type.html#file-attribute-recurse
.


 

> If I go with [1] it affects the permission only to the directory which are 
> getting synced off puppet:///files/home/bala/ (i.e /home/bala 
> /home/bala/cow /home/bala/cat /home/bala/tiger).
>


As written, [1] is just wrong.  It *would* convert the named directory to a 
plain (empty) file (ensure => 'file') if you also specified force => true.  
Inasmuch as you did not use 'force', the resource should just fail.  Any 
behavior associated with the 'sourceselect' and 'recurse' parameters under 
these circumstances is undocumented and therefore subject to change without 
notice.

 

>
> My ideal goal is to have something like [3] where the permission get 
> enforced only on the directory and subdirectories over-riding the UMASK 
> which I have set previously.  The enforced permission should not get 
> applied on the files which are getting synced (i.e /home/bala/temp.txt).  
> Currently when I follow [3] it changed the permission of 
> /home/bala/temp.txt to 755 as well.
>
>

If you have explicit File resources for some of the files under your 
recursively-managed directory, then those should take precedence over any 
recursively-derived ones.  So, I think this should work for you:

file { '/home/bala':
  ensure  => 'directory',
  source  => 'puppet:///files/home/bala',
  # sourceselect doesn't matter because there's only one source
  recurse => 'remote',
  mode    => '0755'
}

file { '/home/bala/temp.txt':
  ensure => 'file',
  source => 'puppet:///files/home/bala/temp.txt',
  mode   => '0640'
}


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/87867400-67a9-4cdb-8692-dd2f97b09d60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to