On Tuesday, May 29, 2018 at 6:55:01 AM UTC-4, Arnau wrote:
>
>
>
> 2018-05-29 12:24 GMT+02:00 Ugo Bellavance <[email protected] <javascript:>>:
>
>>
>>
>> On Tuesday, May 29, 2018 at 5:54:54 AM UTC-4, Arnau wrote:
>>>
>>> Hi,
>>>
>>> postgresql::server::contrib::package_name: 'rh-postgresql96-postgresql-
>>> contrib'
>>> postgresql::server::contrib::packages_ensure: present
>>>
>>>
>> I don't get the error anymore.  It's not doing what it's supposed but 
>> I'll look into it. I'll try the same thing with the manifest just to see.
>>
>
> What is it doing ?
>

It should be install the package with the name specified in 
postgresql::server::contrib::package_name

Setting the parameters in the manifest works:

class {'postgresql::server::contrib':
  package_name        => 'rh-postgresql96-postgresql-contrib',
  package_ensure      => 'present',
}

But this hiera data doesn't:

postgresql::server::contrib::package_name: 
'rh-postgresql96-postgresql-contrib'
postgresql::server::contrib::packages_ensure: present

What vesion of pupet/hiera? what version of the postgres module are you 
> using?
>

# puppet -V
4.10.10

# hiera -V
1.3.4

puppetlabs-postgresql (v5.3.0)

I ran puppet in debug mode and when I use the manifest, I can see all the 
entries related to Package[postgresql-contrib], but nothing when using 
hiera.
 

>
>
>
>> But why do we have to use create_resources for the postgresql::server::db 
>> section but all the others are OK? Is it just because 
>> postgresql::server::db is an array?
>>
>
>
> *create_resources*
>
> Converts a hash into a set of resources and adds them to the catalog.
>
> This function takes two mandatory arguments: a resource type, and a hash 
> describing a set of resources. The hash should be in the form {title => 
> {parameters} }:
>
>
> *postgresql::server::db *is a *define*
> *postgresql::server::contrib* is a *class*
>
> In the first case you use create_resources cause you want to create 
> resources from the type postgresql::server::db (one or many). So the 
> create_resources function expects a hash with a list of databases + its 
> parameters.
>
> The second case you want to pass values to a class parameters. The class 
> does not expect any has:
>
> class postgresql::server::contrib (
> String $package_name = $postgresql::params::contrib_package_name,
> String[1] $package_ensure = 'present'
> ) inherits postgresql::params {
>
>
So class parameters are automatically looked up in hiera, but define 
parameters (or whatever name it is for objects) is not?

-- 
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/26e7eed0-566d-474e-afab-d6c633dec289%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to