[Puppet Users] Re: mount point directory permissions

2016-09-23 Thread jcbollinger
On Friday, March 21, 2014 at 11:41:25 AM UTC-5, Paolo wrote: > > Hi > > I have the following problem: in a certain module I need to set > permissions on a directory after the mount was executed. If I do the > following > > file { '/app_dir': > ensure => 'directory' > owner =>

Re: [Puppet Users] Re: mount point directory permissions

2016-09-22 Thread Garrett Honeycutt
On 9/22/16 6:54 AM, otheus uibk wrote: > Chiming in... > > The old feature request at https://projects.puppetlabs.com/issues/4815 > had it right. This should > be a part of the core Mount resource type. Eric's rejection of it was > stupid. On most

Re: [Puppet Users] Re: mount point directory permissions

2016-09-22 Thread otheus uibk
Chiming in... The old feature request at https://projects.puppetlabs.com/issues/4815 had it right. This should be a part of the core Mount resource type. Eric's rejection of it was stupid. On most systems, when you mount a volume, the underlying

Re: [Puppet Users] Re: mount point directory permissions

2014-03-24 Thread Dirk Heinrichs
Am 23.03.2014 09:57, schrieb Stefan Schulte: That's what I'd do, too. But you can use `creates` paramter to do the check, there is no need to invoke an external command. exec { 'create_mntpoint_/mnt/foo': command = '/bin/mkdir -m 0755 /mnt/foo', creates = '/mnt/foo', }

Re: [Puppet Users] Re: mount point directory permissions

2014-03-24 Thread Paolo Supino
Hi Stefan you're solution is what I did before I posted to the list, but I feel it's too much of a hack and think that there are cleaner and better ways to do it. On Sun, Mar 23, 2014 at 9:57 AM, Stefan Schulte stefan.schu...@taunusstein.net wrote: On 21.03.2014 19:53, José Luis Ledesma

Re: [Puppet Users] Re: mount point directory permissions

2014-03-24 Thread Paolo Supino
Peter I like your approach very much and think I'll implemente it :-) TIA Paolo On Fri, Mar 21, 2014 at 6:48 PM, Peter Bukowinski pmb...@gmail.com wrote: It may not be the nicest way to handle it, but it's not all that cumbersome. If your mount command is modifying the permissions,

Re: [Puppet Users] Re: mount point directory permissions

2014-03-24 Thread Dirk Heinrichs
Am 21.03.2014 18:48, schrieb Peter Bukowinski: exec { 'fix_mount_perms': command = 'chmod 2755 /app_dir chown root:root /app_dir', refreshonly = true, } Setting the exec's refreshonly parameter to true prevents it from running every time, but it will run any time the mount resource

Re: [Puppet Users] Re: mount point directory permissions

2014-03-24 Thread Felix Frank
Hi, On 03/24/2014 07:53 AM, Dirk Heinrichs wrote: But that's not the OP's problem. Creating the mount point can be perfectly accomplished with a file resource. The problem is to adjust permissions AFTER mounting something there w/o having to wait for the next agent run. the point of using

Re: [Puppet Users] Re: mount point directory permissions

2014-03-24 Thread Peter Bukowinski
That's what the notify parameter in the mount resource does. -- Peter On Mar 24, 2014, at 5:38 AM, Dirk Heinrichs d...@recommind.com wrote: Am 21.03.2014 18:48, schrieb Peter Bukowinski: exec { 'fix_mount_perms': command = 'chmod 2755 /app_dir chown root:root /app_dir', refreshonly

Re: [Puppet Users] Re: mount point directory permissions

2014-03-24 Thread Dirk Heinrichs
Am 24.03.2014 12:10, schrieb Peter Bukowinski: That's what the notify parameter in the mount resource does. Yes, you're right. I always use subscribe instead of notify and didn't even recognize you use the latter ;) Bye... Dirk -- *Dirk Heinrichs*, Senior Systems Engineer, Engineering

Re: [Puppet Users] Re: mount point directory permissions

2014-03-23 Thread Stefan Schulte
On 21.03.2014 19:53, José Luis Ledesma wrote: I prefer the exec resource to create the mount point ( with onlyif ! Test-d mountpoint) and the file resource to set the proper permissions. Regards, That's what I'd do, too. But you can use `creates` paramter to do the check, there is no need to

Re: [Puppet Users] Re: mount point directory permissions

2014-03-23 Thread José Luis Ledesma
A lot cleaner! Always used creates for unzipping, didn't though about using it for mkdir Thanks! El 23/03/2014 09:56, Stefan Schulte stefan.schu...@taunusstein.net escribió: On 21.03.2014 19:53, José Luis Ledesma wrote: I prefer the exec resource to create the mount point ( with onlyif !

[Puppet Users] Re: mount point directory permissions

2014-03-21 Thread Renan Vicente
you can use notify for a Exec and use a exec { 'fix permission': command = 'chmod 0755 /app_dir ; chown root:root /app_dir' } something like that, I didn't test

Re: [Puppet Users] Re: mount point directory permissions

2014-03-21 Thread Paolo Supino
Hi Renan between the solutions I tried was something like this, only that the exec fix permissions got executed on every run of puppet... On Fri, Mar 21, 2014 at 5:53 PM, Renan Vicente renanv...@gmail.com wrote: you can use notify for a Exec and use a exec { 'fix permission':

Re: [Puppet Users] Re: mount point directory permissions

2014-03-21 Thread guto carvalho
Try to use paramters like unless, refreshonly or onlyinf to trigger the command in specific conditions, not every time, inside your exec. http://docs.puppetlabs.com/references/latest/type.html#exec-attributes http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-refreshonly

Re: [Puppet Users] Re: mount point directory permissions

2014-03-21 Thread Paolo Supino
Hi Guto Too cumbersome: Have to setup a check for ownership, groupship and permissions... :-( On Fri, Mar 21, 2014 at 6:28 PM, guto carvalho gutocarva...@gmail.comwrote: Try to use paramters like unless, refreshonly or onlyinf to trigger the command in specific conditions, not every time,

Re: [Puppet Users] Re: mount point directory permissions

2014-03-21 Thread Peter Bukowinski
It may not be the nicest way to handle it, but it's not all that cumbersome. If your mount command is modifying the permissions, than you can tell it to notify an exec resource that fixes the perms. file { '/app_dir': ensure = 'directory' owner = 'app_user' group = 'app_group'

Re: [Puppet Users] Re: mount point directory permissions

2014-03-21 Thread José Luis Ledesma
I prefer the exec resource to create the mount point ( with onlyif ! Test-d mountpoint) and the file resource to set the proper permissions. Regards, El 21/03/2014 18:48, Peter Bukowinski pmb...@gmail.com escribió: It may not be the nicest way to handle it, but it's not all that cumbersome. If