java - Puppet "require" not working as expected -



java - Puppet "require" not working as expected -

i have next 2 manifests:

class profile::maven inherits profile::base { # hiera $version = hiera('profile::maven::version', '3.2.1') $settings = hiera_hash('profile::maven::settings', undef) $environments = hiera_hash('profile::maven::environments', undef) # dependencies require '::profile::java' # modules class { '::maven::maven': version => $version, } if ($settings) { create_resources('::maven::settings', $settings) } if ($environments) { create_resources('::maven::environments', $environments) } }

and

class profile::java inherits profile::base { # hiera $distribution = hiera('profile::java::distribution', 'jdk') $version = hiera('profile::java::version', 'present') # modules class { '::java': distribution => $distribution, version => $version, } # parameters $java_home = $::java::java_home file { 'profile-script:java.sh': ensure => present, path => '/etc/profile.d/java.sh', content => template('profile/java.sh.erb'), }

}

i want profile::java has finished before profile::maven executed.

the site.pplooks follows , should not modified in order comply puppet's role-profile approach later (work in progress):

node 'gamma.localdomain' { include 'profile::java' include 'profile::maven' }

after compilation scripts starts downloading maven archive. why does

require '::profile::java'

not ensure execution order? has thought how accomplish desired behavior?

i believe problem here require profile::java scoped profile::maven class, resources declared in latter class depend on profile::java. however, not propagate classes profile::maven declares, such maven::maven.

to accomplish that, can found dependency among classes

include profile::java include maven::maven class[profile::java] -> class[maven::maven]

this can incur substantial complexity in dependency graph, wary of that. can avoided using anchor pattern.

note utilize of require function discouraged due possible dependency cycle issues.

java maven puppet

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -