Skip to content

Instantly share code, notes, and snippets.

@binford2k
Last active March 27, 2018 20:17
Show Gist options
  • Save binford2k/ff402125f4a9782dd3ee1a5c3cc63239 to your computer and use it in GitHub Desktop.
Save binford2k/ff402125f4a9782dd3ee1a5c3cc63239 to your computer and use it in GitHub Desktop.
# Press the 'show relationships' button
# to see how these classes relate to one another
class outside {
include floater # this class is uncontained, so it will "float" outside the graph
contain contained # this class is contained, so it will be enforced within the parent class
require required # this class is required, so all we know is that it will be enforced before the parent class
}
class floater {
file { '/tmp/foo':
ensure => file,
before => Notify['floater'],
}
notify { 'floater': }
}
class contained {
file { '/tmp/bar':
ensure => file,
before => Notify['contained'],
}
notify { 'contained': }
}
class required {
file { '/tmp/buz':
ensure => file,
before => Notify['required'],
}
notify { 'required': }
}
class anotherthing {
notify { 'hello there':
# notice that this relationship doesn't involve class required
require => Class['outside'],
}
}
# include the class in the rendered catalog
include outside
# include another class that has a dependency on outside
include anotherthing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment