2009/9/16 Nigel Kersten <nig...@google.com>:
>
>
> On Tue, Sep 15, 2009 at 5:39 PM, Bostjan Skufca <bostjan.sku...@gmail.com>
> wrote:
>>
>> Hi!
>>
>> Does anybody know, if resources can be inherited?
>>
>> Example:
>>
>> I would like to define three files with owner=root and group=bin and
>> mode=754.
>> To do that you can write:
>> file { "file1":
>>  owner=root,
>>  group=bin,
>>  mode=754,
>> }
>> file { "file2":
>>  owner=root,
>>  group=bin,
>>  mode=754,
>> }
>> file { "file3":
>>  owner=root,
>>  group=bin,
>>  mode=754,
>> }
>>
>>
>> As you can see there is a bit of redundancy there.
>
> You should do this with setting resource defaults in the current scope
> instead like:
>
> File { ensure => file, owner => root, group => bin, mode => 0754, }
>
> file { ["file1", "file2", "file3"]: }
>

Or:

file { ["file1", "file2", "file3"]:
    owner=root,
    group=bin,
    mode=754,
}

Or using a define or articulated as:

    file {
        "file1":
            owner => "root",
            group => "bin",
            mode  => 754;
        "file2":
            owner => "root",
            group => "bin",
            mode  => 754;
        "file3":
            owner => "root",
            group => "bin",
            mode  => 754;
    }

Regards

James Turnbull

-- 
Author of:
* Pro Linux Systems Administration (http://tinyurl.com/linuxadmin)
* Pulling Strings with Puppet (http://tinyurl.com/pupbook)
* Pro Nagios 2.0 (http://tinyurl.com/pronagios)
* Hardening Linux (http://tinyurl.com/hardeninglinux)

--~--~---------~--~----~------------~-------~--~----~
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