Last active
December 21, 2015 04:58
-
-
Save ahpook/6253057 to your computer and use it in GitHub Desktop.
Containment example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node default { | |
notify { 'final notice': | |
message => "this should come last" | |
} <- | |
class { 'containers': } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this class is brought in with an 'include' statement | |
class containers::includedclass { | |
notify { "includedclass": | |
message => "This should be in the middle" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example class intended to exercise containment in a minimal way | |
# that still reflects real-world usage, modelled after puppetlabs-apt | |
class containers { | |
notify { "containers": | |
message => "This should be first" | |
} | |
# the resources in here are supposed to be contained | |
contain containers::includedclass | |
# with 'include' instead of 'contain', this is needed to | |
# prevent includedclass from 'float' | |
#anchor { 'containers-anchor': | |
# require => Class['containers::includedclass'] | |
#} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment