Hi,
I have a Puppet manifest which makes use of the tomcat::instance defined type from the camptocamp/tomcat module on the Puppet Forge as follows:
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
This makes some sense to me, since I’m not defining an order in which Puppet should run these resources. If the Tomcat module is not evaluated in to the catalogue before I use the tomcat::instance resource, then failures will occur.
How can I get Puppet to instantiate the Tomcat module first before then looking to work with tomcat::instance? Adding the require metaparameter to the tomcat::instance resource doesn't appear to do what I want it to do (i.e. evaluate the include before using the resource).
I’ve seen a related problem before, and fixed that after a while, but this one’s got me a bit stumped. It doesn't help either that I can't remember how I fixed the last issue, even after looking through Git commits. Sad times.
Thanks!
Andrew
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
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',}
}
==> 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 evaluatedValues 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 puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/2d506a73-c86a-4ddd-bfd4-09579565bd04%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/w9mVNiq8kAk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACZQQfO4BWWK3_aZ2xBWSRaKGnGp00uaA66DVFxkL-7jdOadbA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAFi_6yJ6rosUveAyYA42FRcdrNU2ruhB8ZA%3D0-EtQWQD%2BWYy1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.