I should probably add that, for $reasons, I'm using Puppet 3.6.1.
On Sunday, 19 July 2015 15:07:39 UTC+1, Andrew Langhorn 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
> ==> 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/7fe8d754-02c0-4277-a55d-56b92b0d7e09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.