Merge pull request #4 from jeffmccune/feedback/master/containment_with_anchors
Contain all classes within Class[nginx]
This commit is contained in:
commit
14d6281d5a
3 changed files with 25 additions and 11 deletions
|
@ -17,6 +17,10 @@
|
|||
# - Debian/Ubuntu: Default Install or custom package
|
||||
# - SuSE: Default Install or custom package
|
||||
#
|
||||
# stdlib
|
||||
# - puppetlabs-stdlib module >= 0.1.6
|
||||
# - plugin sync enabled to obtain the anchor type
|
||||
#
|
||||
# Sample Usage:
|
||||
#
|
||||
# The module works with sensible defaults:
|
||||
|
@ -28,11 +32,6 @@ class nginx {
|
|||
|
||||
class { 'stdlib': }
|
||||
|
||||
anchor{ 'nginx::begin':
|
||||
before => Class['nginx::package'],
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
|
||||
class { 'nginx::package':
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
|
@ -44,6 +43,13 @@ class nginx {
|
|||
|
||||
class { 'nginx::service': }
|
||||
|
||||
# Allow the end user to establish relationships to the "main" class
|
||||
# and preserve the relationship to the implementation classes through
|
||||
# a transitive relationship to the composite class.
|
||||
anchor{ 'nginx::begin':
|
||||
before => Class['nginx::package'],
|
||||
notify => Class['nginx::service'],
|
||||
}
|
||||
anchor { 'nginx::end':
|
||||
require => Class['nginx::service'],
|
||||
}
|
||||
|
|
|
@ -21,8 +21,9 @@ class nginx::service {
|
|||
}
|
||||
service { "nginx":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
enable => true,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
subscribe => Exec['rebuild-nginx-vhosts'],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,9 @@
|
|||
include nginx
|
||||
|
||||
# The notify before should always come BEFORE all resources
|
||||
# managed by the nginx class
|
||||
# and the notify last should always come AFTER all resources
|
||||
# managed by the nginx class.
|
||||
node default {
|
||||
notify { 'before': }
|
||||
-> class { 'nginx': }
|
||||
-> notify { 'last': }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue