Skip to content

Instantly share code, notes, and snippets.

@ahpook
Last active December 21, 2015 04:58
Show Gist options
  • Save ahpook/6253057 to your computer and use it in GitHub Desktop.
Save ahpook/6253057 to your computer and use it in GitHub Desktop.
Containment example
node default {
notify { 'final notice':
message => "this should come last"
} <-
class { 'containers': }
}
# this class is brought in with an 'include' statement
class containers::includedclass {
notify { "includedclass":
message => "This should be in the middle"
}
}
# 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