On Sun, Jul 19, 2015 at 7:07 AM, Andrew Langhorn <
[email protected]> wrote:

> Hi Felix,
>
> Thanks for the reply.
>
> Yep - that snippet is representative. I've copied the full thing for you
> below. Granted, it needs some tidying up, but I think it should just work
> as it stands:
>
> class app::reservations {
>
> include tomcat
>
>
> Exec {
>   path => "/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin",
> }
>
>
> tomcat::instance { 'reservations':
>   ensure    => present,
>   http_port => 8080,
>   require   => Class['tomcat'],
> }
>
>
> file { '/srv/tomcat/reservations/webapps/reservations.war':
>   ensure => present,
>   source => 'puppet:///modules/app/reservations.war',
>   owner  => 'tomcat',
>   group  => 'adm',
>   mode   => '0755',
>   notify => Exec['restart-reservations-tomcat'],
>   }
>
>
> exec { 'restart-reservations-tomcat':
>   command => '/etc/init.d/tomcat-reservations restart',
> }
>
>
> }
>
>
> Under normal circumstances, I agree that explicitly including the Tomcat
> class up above the instantiation of the tomcat::instance class should work
> fine. I don't know why it's not working quite as expected. Here's the
> output from Puppet with the --debug flag:
>
> ==> app: Debug: importing
> '/opt/puppet/modules/app/manifests/reservations.pp' in environment
> development
> ==> app: Debug: Automatically imported app:reservations from
> app/reservations in to development
> ==> app: Debug: importing '/opt/puppet/modules/app/manifests/tomcat.pp' in
> environment development
>

It looks like the loader found app/manifests/tomcat.pp instead of
tomcat/manifests/init.pp.  Perhaps qualify the include as `include
::tomcat`?  Not sure if that would work with Puppet 3.6 though.


> ==> app: Debug: Automatically imported app::tomcat from app/tomcat into
> development
>
==> app: Debug: importing
> '/opt/puppet/vendor/modules/tomcat/manifests/instance.pp' in environment
> development
> ==> app: Debug: Automatically imported tomcat::instance from
> tomcat/instance into development
> ==> app: Warning: Scope(Tomcat::Instance[reservations]): Could not look up
> qualified variable 'tomcat::instance_basedir'; class tomcat has not been
> evaluated
> ==> app: Warning: Scope(Tomcat::Instance[reservations]): Could not look up
> qualified variable 'tomcat::version'; class tomcat has not been evaluated
>
> Values for both tomcat::version and tomcat::instance_basedir are retrieved
> from a case statement which, ultimately, resides at
> https://github.com/camptocamp/puppet-tomcat/blob/master/manifests/params.pp,
> which either works out a value or just passes in a value, respectively.
>
> So, it looks like the Tomcat module is - at least partially - being
> imported.
>
> I'm a bit stumped now!
>
> Andrew
>
> On Sunday, 19 July 2015 01:06:26 UTC+1, Felix.Frank wrote:
>>
>>  On 07/19/2015 01:19 AM, Andrew Langhorn wrote:
>>
>>  class apps::reservations {
>>
>>
>>    include tomcat
>>
>>
>>    tomcat::instance { ‘reservations’:
>>
>>    ensure => present,
>>
>>   http_port => 8080,
>>
>>    }
>>
>>
>>   }
>>
>>
>>  However, when I run Puppet against a Vagrant VM, it tells me that the
>> tomcat class hasn’t been evaluated, so it can’t use tomcat::instance
>> (because of underlying failures when using the Tomcat module):
>>
>>
>>   ==> app: Warning: Scope(Tomcat::Instance[reservations]): Could not
>> look up qualified variable 'tomcat::instance_basedir'; class tomcat has not
>> been evaluated
>>
>>
>> Hmm, if the resource declaration is lexically preceded by an 'include
>> tomcat' then this should not happen.
>>
>> In this case, the order in your manifest is really important. Is your
>> snippet truly representative of your actual code?
>>
>> Regards,
>> Felix
>>
>  --
> 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/2d506a73-c86a-4ddd-bfd4-09579565bd04%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/2d506a73-c86a-4ddd-bfd4-09579565bd04%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Join us at **PuppetConf 2015, October 5-9 in Portland, OR - *www.
<http://www.google.com/url?q=http%3A%2F%2Fwww.&sa=D&sntz=1&usg=AFQjCNEnS7itqgvQV3E4Se1fu4Um_UapSw>
2015.puppetconf.com
<http://www.google.com/url?q=http%3A%2F%2F2015.puppetconf.com&sa=D&sntz=1&usg=AFQjCNE1uQL4Sh23Vr-XkPLa4xfNcoXSog>

*Register early to save 40%!*

-- 
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/CACZQQfO4BWWK3_aZ2xBWSRaKGnGp00uaA66DVFxkL-7jdOadbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to