can't seem figure this out.
Here is my data:
common.yaml
nfsshares:
"nfsshare-public":
name: /var/public
device: "hostname1:/vol/public"
remounts: true
options: 'rw,bg,hard'
"nfsshare-private":
name: /var/private
ensure: mounted
device: 'hostname2:/var/private'
remounts: true
options: 'rw,bg,hard'
now on the node level:
my-test-server.yaml
nfs::client::nfs_resouce_name: [ 'nfsshare-public', "nfsshare-private" ]
struggling to make class "nfs::client"
to create resources 'nfsshare-public', "nfsshare-private" based on the
above data in hiera without making "create_resources" inside of
"create_resources" or run loop on nfs_resouce_name and then
create_resource for each item.
There must be simpler way.
Any hints appreciated.
Andrey
Andrey
On 14 January 2014 02:38, Ian Mortimer <[email protected]> wrote:
> On 14/01/14 03:49, Andrey Kozichev wrote:
>
> This scenario works well if on the class input I just supply single
>> mountpoint -> then I do hiera("mountpointname") and create_resources()
>> But if I want to have multiple Mountpoints defined per host I need to
>> supply an Array to the class and then iterate it and fetch details for
>> each mountpoint. I can probably do this by using new 3.2 syntax with
>> "each", but I would like to avoid this.
>>
>> Do you have any better way to implement this?
>>
>
> If in hiera you define a hash of hashes (instead of an array of hashes)
> you can pass that to create_resources which will create a resource for
> each hash.
>
>
> --
> Ian
> [email protected] Ian Mortimer
> Tel: +61 7 3346 8528 Science IT
> University of Queensland
>
>
> --
> 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/52D4A329.9000608%40uq.edu.au.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
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/CACzr%3DFfwC_g0qfdiJrWCG5Ri-zQaY1cez5Jf6_2mzZZyC5-pmA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.