Skip to content

Commit

Permalink
Fix repo::apt and repo::yum containment
Browse files Browse the repository at this point in the history
This patch uses contain and therefore removes support for Puppet versions
below 3.4.0
  • Loading branch information
juniorsysadmin committed Apr 25, 2015
1 parent 5d333a9 commit 6b849f2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
##2015-02-27 0.8.0
###Backwards-incompatible changes
- Puppet versions below 3.4.0 are no longer supported
- Debian Squeeze and Fedora version 18 and below are explicitly no longer
supported
- Parameter naming changes to node_pkg, npm_pkg, dev_pkg, manage_repo,
Expand Down
7 changes: 2 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@

include '::nodejs::install'

anchor { '::nodejs::begin': }
anchor { '::nodejs::end': }

if $manage_package_repo {
include $repo_class
Anchor['::nodejs::begin'] ->
anchor { '::nodejs::begin': } ->
Class[$repo_class] ->
Class['::nodejs::install'] ->
Anchor['::nodejs::end']
anchor { '::nodejs::end': }
}
}
13 changes: 11 additions & 2 deletions manifests/repo/nodesource.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
case $::osfamily {
'RedHat': {
if $::operatingsystemrelease =~ /^5\.(\d+)/ {
include '::epel'
include ::epel
$dist_version = '5'
$name_string = 'Enterprise Linux 5'
}
Expand Down Expand Up @@ -51,6 +51,13 @@
$source_baseurl = "https://rpm.nodesource.com/pub/${dist_type}/${dist_version}/SRPMS"

class { '::nodejs::repo::nodesource::yum': }
contain '::nodejs::repo::nodesource::yum'

if $::operatingsystemrelease =~ /^5\.(\d+)/ {
# On EL 5, EPEL needs to be applied first
Class['::epel'] -> Class['::nodejs::repo::nodesource::yum']
}

}
'Linux': {
if $::operatingsystem == 'Amazon' {
Expand All @@ -76,6 +83,7 @@
$source_baseurl = "https://rpm.nodesource.com/pub/${dist_type}/${dist_version}/SRPMS"

class { '::nodejs::repo::nodesource::yum': }
contain '::nodejs::repo::nodesource::yum'
}

else {
Expand All @@ -85,7 +93,8 @@
}
}
'Debian': {
class { 'nodejs::repo::nodesource::apt': }
class { '::nodejs::repo::nodesource::apt': }
contain '::nodejs::repo::nodesource::apt'
}
default: {
if ($ensure == 'present') {
Expand Down

0 comments on commit 6b849f2

Please sign in to comment.