notify relationship of config does not propagate from subconfig file

asked 2016-02-05 05:54:40 -0600

teleivo gravatar image

updated 2016-02-05 05:58:12 -0600

Dear community,

I am having trouble in my understanding of a notify relationship and class containment.

I have a module with following init.pp

class dcm4chee () {
    anchor { '::dcm4chee::begin': } ->
      class { '::dcm4chee::install': } ->
      class { '::dcm4chee::config': } ~>
      class { '::dcm4chee::service': } ->
    anchor { '::dcm4chee::end': }
}

and following config.pp

class dcm4chee::config () {
  $database_class = "::dcm4chee::config::${dcm4chee::database_type}"

  anchor { 'dcm4chee::config_begin': } ->
  class { $database_class: } ->
  class { '::dcm4chee::config::jboss': } ->
  anchor { 'dcm4chee::config_end': }
}

config/jboss.pp

class dcm4chee::config::jboss () {
    file { "${::dcm4chee::jboss_bin_path}run.conf":
      ensure  => file,
      mode    => '0644',
      content => template('dcm4chee/jboss_home/bin/run.conf.erb'),
    }
}

So whenever the run.conf file changes I would expect a notification of the service which should then restart.

However this does not happen. It only happens when 1. I add a class { '::dcm4chee::config::jboss': } ~> anchor { 'dcm4chee::config_end': } in the config.pp 2. I move the file resource of run.conf into config.pp

I thought that if I use anchors on my the sub class/layer of class { '::dcm4chee::config::jboss': } that this would contain it and thus cause a service restart.

I would be very grateful if someone could shed some light on my little puppet nightmare ;)

edit retag flag offensive close merge delete