Puppet class dependency management

asked 2018-08-27 23:01:27 -0600

Suppose I have a class that installs packages(profile::base::tools) and another class that defines the yumrepos(profile::base::yum) required for those packages.


class profile::base::tools {
   $packages = [

   package { $packages:
     ensure => present,

Currently the way it is run is through base.pp:


include profile::base::yum 
include profile::base::tools

Class['profile::base::yum'] -> [

So when I run base.pp it creates the yum repos first and then installs the packages. Currently the dependency that the tools.pp requires yumrepos defined first is only mentioned in the base.pp. My question is if i run tools.pp alone(for testing purposes) it wont know about the dependency and hence fail. I can add include profile::base::yum in the tools.pp class but wanted to know if its a standard for each class to know about dependencies even if its already defined elsewhere(like in base.pp).

edit retag flag offensive close merge delete