Skip to content

Commit

Permalink
Contain all classes within Class[nginx]
Browse files Browse the repository at this point in the history
This change uses the anchor relationship from the puppetlabs-stdlib
module to contain all of the module classes within the main "ntp" class.

Without this change, end users of the module may have difficulty
ordering things correctly since they will have to peek inside the module
and figure out it's internal workings to identify all classes that
require relationship edges.
  • Loading branch information
Jeff McCune committed Jan 3, 2012
1 parent a6f98a8 commit f608b8f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions manifests/init.pp
Expand Up @@ -11,12 +11,16 @@
#
# Requires:
# puppetlabs-stdlib - https://github.com/puppetlabs/puppetlabs-stdlib
#
#
# Packaged NGINX
# - RHEL: EPEL or custom package
# - 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:
Expand All @@ -25,15 +29,10 @@
# include nginx
# }
class nginx {

class { 'stdlib': }

anchor{ 'nginx::begin':
before => Class['nginx::package'],
notify => Class['nginx::service'],
}

class { 'nginx::package':
class { 'nginx::package':
notify => Class['nginx::service'],
}

Expand All @@ -44,6 +43,13 @@

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'],
}
Expand Down

0 comments on commit f608b8f

Please sign in to comment.