grundic / puppet-teamcity

Teamcity module for puppet
9 stars 14 forks source link

Cannot use this module with dependencies #16

Open alexqyle opened 8 years ago

alexqyle commented 8 years ago

Hi,

I tried to use this module in my puppet code. Since java installation is not included, I need to add dependency on my java module when using this teamcity module in my code. However, puppet would not respect to the dependency I added in code:

class profile::my_teamcity_agent {
  include ::my_java

  class { '::teamcity':
    agent_user  => 'root',
    agent_group => 'root',
    server_url  => 'http://test.server:8111',
    agent_dir   => '/opt/buildAgent',
    require => Class['::my_java'],
  }
}

With this code, I did puppet apply --graph. It actually shows that java and teamcity::agent modules are on the same level in execution pipeline, which means there is no dependency between these two modules. As a result, my teamcity profile would fail when puppet tried to start teamcity service before java being installed.

After some investigation, the problem is caused by include ::teamcity::agent in class teamcity. As indicated by puppet document ([https://docs.puppet.com/puppet/latest/reference/lang_containment.html#the-contain-function]), include would not really ensure the execution dependencies. For puppet > 3.4.0, it should use contain. And for puppet <= 3.4.0, it should use anchor pattern.

I will submit a PR shortly to address this issue.

Thanks,

Alex