Alex

The 'Resource[]' syntax is a resource reference, whereas 'resouce {}' is 
the declaration syntax - 
See 
https://docs.puppet.com/puppet/latest/reference/lang_data_resource_reference.html
 
and 
https://docs.puppet.com/puppet/latest/reference/lang_resources.html#simplified-syntax

With regards to erroring, you don't need to do anything special, other than 
setup the relationship using 'before/requires' between the Logical_Volume 
resource and the Postgresql class. 

If the Logical_Volume resource fails to apply, then Puppet will skip the 
Postgresql class. 

Also, you don't need to explicitly order the LVM PV<>VG<>LV resources, as 
they already setup the requires dependencies in the resource providers - 
See 
https://docs.puppet.com/puppet/latest/reference/lang_relationships.html#auto-relationships

HTH

Gav

On Wednesday, 17 August 2016 00:55:42 UTC+1, Alex Samad wrote:
>
> HI
>
> So got this to work 
>
>     volume_group { 'vg_pgdata':
>       ensure => present,
>       physical_volumes => '/dev/sdc1'
>     }
>
>     logical_volume { 'lv_pgdata92':
>       ensure => present,
>       volume_group => 'vg_pgdata',
>
>       require => Volume_Group['vg_pgdata'],
>
>     }
>
>
> Also found out that I can't have spaces between File and [
>
> so 
> File[ is difference from File [
>
> Not sure I fully understand the <resource>[] and the difference between 
> <resource>{ '':}
>
> A
>
>
> On Wednesday, 17 August 2016 09:44:42 UTC+10, Alex Samad wrote:
>>
>> Hi
>>
>> Just tried this
>>
>>
>>     logical_volume { 'lv_pgdata92':
>>       ensure => present,
>>       volume_group => 'vg_pgdata',
>>
>>       requires => volume_group { 'vg_pgdata':
>>           ensure => present,
>>           physical_volumes => '/dev/sdc1'
>>         }
>>
>> Got this 
>> Error: Could not retrieve catalog from remote server: Error 400 on 
>> SERVER: Evaluation Error: Error while evaluating a Resource Statement, 
>> Syntax error at '{' at 
>> /etc/puppetlabs/code/environments/testing/site/profile/manifests/ybpostgresql92.pp:51:32
>>  
>> on node bitbucket.yieldbroker.com
>> W
>>
>>
>> On Wednesday, 17 August 2016 09:27:29 UTC+10, Alex Samad wrote:
>>>
>>> Okay
>>>
>>> that sounds okay, how do I add fatal call to it to stop it processing 
>>> any more 
>>>
>>> Alex
>>>
>>> On Tuesday, 16 August 2016 17:53:33 UTC+10, Gavin Williams wrote:
>>>>
>>>> Alex
>>>>
>>>> You're looking for 'Requires' - See 
>>>> https://docs.puppet.com/puppet/latest/reference/lang_relationships.html
>>>>
>>>> Basically, you can add "requires => Logical_Volume['lv_pgdata']" to the 
>>>> 'postgresql::server' class, and if the Logical_Volume resource fails for 
>>>> whatever reason, then the 'postgresql::server' class will be skipped... 
>>>>
>>>> HTH
>>>>
>>>> Gav
>>>>
>>>>> [snip]
>>>>>
>>>>

-- 
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/b35453f8-007c-4b39-981e-5ca6b49d1560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to