Yeh, the quoting of the resource is key I found... Need to quote the entire
resource, rather than the resource title...
Gav
On Thursday, 19 December 2013 00:45:11 UTC, Mikhail Simin wrote:
>
> This syntax works for me:
>
> 'require' => [
> 'User[nginx]',
> 'Exec[install_nginx]']
>
> On Wednesday, October 2, 2013 4:45:01 AM UTC-7, Johan De Wit wrote:
>>
>> When 'require' multiple resources, you should copy what the catalog
>> contains :
>>
>>
>>
>>
>>
>>
>>
>>
>> * 'require' => '[User[nginx]{:name=>"nginx"},
>> Exec[install_nginx]{:command=>"install_nginx"}]',in the rspec file. Thats
>> the only way i could make it pass the test.Grtsjo*
>>
>>
>> On Saturday, 21 September 2013 01:52:34 UTC+2, Guy Knights wrote:
>>>
>>> No such luck. I all the above suggestions (capitalising class names,
>>> removing inner quotes) with another require:
>>>
>>> * file { 'set_nginx_dir_permissions':*
>>> * ensure => directory,*
>>> * path => "/opt/nginx-${version}",*
>>> * owner => nginx,*
>>> * group => nginx,*
>>> * mode => '0644',*
>>> * require => [User['nginx'],Exec['install_nginx']],*
>>> * }*
>>>
>>> but it says the catalogue is set to *[User[nginx]{:name=>"nginx"},
>>> Exec[install_nginx]{:command=>"install_nginx"}]*, which is what I was
>>> getting with the other require.
>>>
>>> On Thursday, 19 September 2013 22:12:34 UTC-7, Dan Bode wrote:
>>>>
>>>> I'm pretty sure the error is b/c the class names need to be capitalized.
>>>>
>>>>
>>>> On Tue, Sep 17, 2013 at 10:05 AM, Guy Knights <
>>>> [email protected]> wrote:
>>>>
>>>>> Can someone tell me the correct way to specify the following require
>>>>> statement in an rspec-puppet test?
>>>>>
>>>>> *require =>
>>>>> [Class['ssl'],Class['pcre3'],Staging::Extract["nginx-${version}.tar.gz"]]*
>>>>>
>>>>> I tried this: *'require' =>
>>>>> "[Class['ssl'],Class['pcre3'],Staging::Extract['nginx-1.4.1.tar.gz']]"*but
>>>>> got the following error:
>>>>>
>>>>>
>>>>> *Failure/Error: )*
>>>>> *expected that the catalogue would contain Exec[install_nginx] with
>>>>> require set to
>>>>> `"[Class['ssl'],Class['pcre3'],Staging::Extract['nginx-1.4.1.tar.gz']]"`
>>>>> but it is set to `[Class[Ssl]{:name=>"Ssl"},
>>>>> Class[Pcre3]{:name=>"Pcre3"},
>>>>> Staging::Extract[nginx-1.4.1.tar.gz]{:name=>"nginx-1.4.1.tar.gz"}]` in
>>>>> the
>>>>> catalogue*
>>>>>
>>>>> I've tried every combination of different quotes, removing the inner
>>>>> quotes, capitalising the resource titles, and even just copying and
>>>>> pasting
>>>>> what the error above says the catalogue is reporting, but it just doesn't
>>>>> work. I thought I had the syntax for requires figured out, but apparently
>>>>> not.
>>>>>
>>>>> Thanks,
>>>>> Guy
>>>>>
>>>>> --
>>>>> 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 post to this group, send email to [email protected].
>>>>> Visit this group at http://groups.google.com/group/puppet-users.
>>>>> 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/4b7dbf7b-9a4c-45ab-861e-b455a3d004ad%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.