Garth Roxburgh-Kidd
2008-Aug-02 13:24 UTC
[Puppet Users] permissions and ownership of files in bulk
Is there an easy way to control the permission and ownership in bulk when creating quite a few files? I''m finding a lot of my recipes contain file{} definitions of this form: file { "/var/foo": ensure => directory, owner => "root", group => "root", mode => 0755; "/var/foo/bar": ensure => directory, owner => "root", group => "root", mode => 0755; "/var/foo/bar/xyzzy": ensure => present, owner => "root", group => "root", mode => 0644; } I''d be fine with some bulk owner => root, group => root, umask => 022. Yours, Garth. --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Felix Schäfer
2008-Aug-02 13:37 UTC
[Puppet Users] Re: permissions and ownership of files in bulk
Hello, Am 02.08.2008 um 15:24 schrieb Garth Roxburgh-Kidd:> Is there an easy way to control the permission and ownership in bulk > when creating quite a few files? I''m finding a lot of my recipes > contain file{} definitions of this form: > > file { > "/var/foo": > ensure => directory, > owner => "root", > group => "root", > mode => 0755; > "/var/foo/bar": > ensure => directory, > owner => "root", > group => "root", > mode => 0755; > "/var/foo/bar/xyzzy": > ensure => present, > owner => "root", > group => "root", > mode => 0644; > } > > I''d be fine with some bulk owner => root, group => root, umask => 022.I think you''d want type defaults. Your stuff could be shortened to: """ File { ensure => directory, owner => "root", group => "root", mode => 0755, } file { "/var/foo": "/var/foo/bar": "/var/foo/var/xyzzy": ensure => present; } """ Warning: not tested! Felix Schäfer --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
James Turnbull
2008-Aug-02 16:49 UTC
[Puppet Users] Re: permissions and ownership of files in bulk
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Felix Schäfer wrote:> Hello, > > Am 02.08.2008 um 15:24 schrieb Garth Roxburgh-Kidd: > >> Is there an easy way to control the permission and ownership in bulk >> when creating quite a few files? I''m finding a lot of my recipes >> contain file{} definitions of this form: >>Garth Or a define would help. Have a look at the language tutorial or Chapter 3 of the book. Cheers James - -- Author of: * Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) * Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) * Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIlJAH9hTGvAxC30ARAqN4AKC7vEza0nvcTYScIqNdO13puQxX7ACgrK0i A73g+9T4k0thGyrGNxAoEMQ=XfxF -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Drayton
2008-Aug-02 19:12 UTC
[Puppet Users] Re: permissions and ownership of files in bulk
Hi On Aug 2, 2:24 pm, "Garth Roxburgh-Kidd" <ga...@deadlybloodyserious.com> wrote:> Is there an easy way to control the permission and ownership in bulk > when creating quite a few files? I''m finding a lot of my recipes > contain file{} definitions of this form: > > file { > "/var/foo": > ensure => directory, > owner => "root", > group => "root", > mode => 0755; > "/var/foo/bar": > ensure => directory, > owner => "root", > group => "root", > mode => 0755; > "/var/foo/bar/xyzzy": > ensure => present, > owner => "root", > group => "root", > mode => 0644; > } > > I''d be fine with some bulk owner => root, group => root, umask => 022.Use an array: file { ["/var/foo", "/var/foo/bar", "/var/foo/bar/xyzzy"]: ensure => present, owner => "root", group => "root", mode => 0644; } I''m not certain but I think the defaults for File are root:root, umask 002 -- when I don''t specify a user/group/umask that''s what I get, anyway. Cheers, Mark --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---