fixed calling out of scope variables

This commit is contained in:
Tomas Barton 2013-10-07 16:27:17 +02:00
parent 6ab27d00b1
commit 303efc634d
3 changed files with 19 additions and 5 deletions

View file

@ -60,6 +60,9 @@ class nginx (
include stdlib include stdlib
class { 'nginx::package': class { 'nginx::package':
package_name => $package_name,
package_source => $package_source,
package_ensure => $package_ensure,
notify => Class['nginx::service'], notify => Class['nginx::service'],
} }

View file

@ -13,7 +13,11 @@
# Sample Usage: # Sample Usage:
# #
# This class file is not called directly # This class file is not called directly
class nginx::package { class nginx::package(
$package_name = 'nginx',
$package_source = 'nginx',
$package_ensure = 'present',
) {
anchor { 'nginx::package::begin': } anchor { 'nginx::package::begin': }
anchor { 'nginx::package::end': } anchor { 'nginx::package::end': }
@ -26,6 +30,9 @@ class nginx::package {
} }
'debian': { 'debian': {
class { 'nginx::package::debian': class { 'nginx::package::debian':
package_name => $package_name,
package_source => $package_source,
package_ensure => $package_ensure,
require => Anchor['nginx::package::begin'], require => Anchor['nginx::package::begin'],
before => Anchor['nginx::package::end'], before => Anchor['nginx::package::end'],
} }

View file

@ -13,11 +13,15 @@
# Sample Usage: # Sample Usage:
# #
# This class file is not called directly # This class file is not called directly
class nginx::package::debian { class nginx::package::debian(
$package_name = 'nginx',
$package_source = 'nginx',
$package_ensure = 'present'
) {
$distro = downcase($::operatingsystem) $distro = downcase($::operatingsystem)
package { $nginx::package_name: package { $package_name:
ensure => $nginx::package_ensure, ensure => $package_ensure,
require => Anchor['nginx::apt_repo'], require => Anchor['nginx::apt_repo'],
} }
@ -25,7 +29,7 @@ class nginx::package::debian {
include '::apt' include '::apt'
case $nginx::package_source { case $package_source {
'nginx': { 'nginx': {
apt::source { 'nginx': apt::source { 'nginx':
location => "http://nginx.org/packages/${distro}", location => "http://nginx.org/packages/${distro}",