Puppet tomcat install doesn't run chained instance resource

103 views Asked by At

I am using the following puppet code to install tomcat and set up an instance on an aws linux 2 ami:

  # install Tomcat package
  ::tomcat::install { '/usr/share/tomcat':
    catalina_home => '/usr/share/tomcat',
    install_from_source => false,
    package_name => 'tomcat'
  } ->

  notify { 'log0':
    message => 'Tomcat install',
  } ->

  ::tomcat::instance { $tomcat_instance:
    catalina_home => '/usr/share/tomcat',
    manage_service => false
  } ->

  notify { 'log1':
    message => 'tomcat instance',
  } ->

Puppet executes the install resource and outputs the log message, but then doesn't seem to execute the instance resource or the second log statement.

Here is the relevant compiled catalog section:

Debug: Adding relationship from Tomcat::Install[/usr/share/tomcat] to Notify[log0] with 'before'
Debug: Adding relationship from Notify[log0] to Tomcat::Instance[default] with 'before'
Debug: Adding relationship from Tomcat::Instance[default] to Notify[log1] with 'before'

Here is the output from a run:

Debug: Executing: '/usr/bin/yum -e 0 -y install tomcat'
Notice: /Stage[main]/Rk_tomcat::Tomcat/Tomcat::Install[/usr/share/tomcat]/Tomcat::Install::Package[tomcat]/Package[tomcat]/ensure: created
Debug: /Package[tomcat]: The container Tomcat::Install::Package[tomcat] will propagate my refresh event
Debug: Tomcat::Install::Package[tomcat]: The container Tomcat::Install[/usr/share/tomcat] will propagate my refresh event
Debug: Tomcat::Install[/usr/share/tomcat]: The container Class[Rk_tomcat::Tomcat] will propagate my refresh event
Notice: Tomcat install
Notice: /Stage[main]/Rk_tomcat::Tomcat/Notify[log0]/message: defined 'message' as 'Tomcat install'
Debug: /Stage[main]/Rk_tomcat::Tomcat/Notify[log0]: The container Class[Rk_tomcat::Tomcat] will propagate my refresh event
Debug: Finishing transaction 28638820
Debug: Storing state
Debug: Pruned old state cache entries in 0.00 seconds
Debug: Stored state in 0.01 seconds
Notice: Applied catalog in 4.01 seconds

Tomcat gets successfully installed:

Server version: Apache Tomcat/7.0.76
Server built:   Jun 22 2020 23:34:41 UTC
Server number:  7.0.76.0
OS Name:        Linux
OS Version:     4.14.231-173.361.amzn2.x86_64
Architecture:   amd64
JVM Version:    1.8.0_282-b08
JVM Vendor:     Red Hat, Inc.

Why are not the chained resources after the log0 resource being run?

0

There are 0 answers