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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.
Does anyone have any feedback on this? I found at least one example (eg. https://genuxation.com/wiki/index.php/RSpec_tests_for_puppet_modules#Specifying_parameters_used_within_the_class) but it didn''t work for me. Thanks, Guy On Tuesday, 17 September 2013 10:05:26 UTC-7, Guy Knights 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Have you tried: *"Class[ssl],Class[pcre3],Staging::Extract[nginx-1.4.1.tar.gz]"* or *"Class[ssl],Class[pcre3],Staging__Extract[nginx-1.4.1.tar.gz]" Corey * On Tuesday, September 17, 2013 10:05:26 AM UTC-7, Guy Knights 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
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 <guy@eastsidegamestudio.com>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 puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > 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 puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
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
<g...@eastsidegamestudio.com<javascript:>
> > 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 puppet-users...@googlegroups.com <javascript:>.
>> To post to this group, send email to
puppet...@googlegroups.com<javascript:>
>> .
>> 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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.
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.
Grts
jo
*
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 <
>> g...@eastsidegamestudio.com> 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 puppet-users...@googlegroups.com.
>>> To post to this group, send email to puppet...@googlegroups.com.
>>> 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 puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.
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 <
>>> g...@eastsidegamestudio.com> 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 puppet-users...@googlegroups.com.
>>>> To post to this group, send email to
puppet...@googlegroups.com.
>>>> 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 puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/b1fb2231-8c8e-4be2-9a65-b90c27fc4c8c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.