Skip to content

Commit

Permalink
apply changes from voxpupuli#786, plus a fix for package not being gp…
Browse files Browse the repository at this point in the history
…g signed
  • Loading branch information
jlambert121 authored and Oleksandr Moskalenko committed Oct 13, 2016
1 parent 5f4db70 commit ad8397d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ nginx::nginx_mailhosts:
## Nginx with precompiled Passenger
Currently this works only for Debian family and OpenBSD.
On Debian it might look like:
On Debian and CentOS it might look like:
```puppet
class { 'nginx':
package_source => 'passenger',
Expand Down
19 changes: 18 additions & 1 deletion manifests/package/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,25 @@
before => Package['nginx'],
}
}
'passenger': {
yumrepo { 'passenger':
baseurl => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/${::operatingsystemmajrelease}/\$basearch",
descr => 'passenger repo',
enabled => '1',
gpgcheck => '0',
repo_gpgcheck => '1',
priority => '1',
gpgkey => 'https://packagecloud.io/gpg.key',
before => Package['nginx'],
}

package { 'passenger':
ensure => 'present',
require => Yumrepo['passenger'],
}
}
default: {
fail("\$package_source must be 'nginx-stable' or 'nginx-mainline'. It was set to '${package_source}'")
fail("\$package_source must be 'nginx-stable', 'nginx-mainline', or 'passenger'. It was set to '${package_source}'")
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@
end
end

context "package_source => passenger" do
let(:params) {{ :package_source => 'passenger' }}
it { is_expected.to contain_yumrepo('passenger').with(
'baseurl' => 'https://oss-binaries.phusionpassenger.com/yum/passenger/el/6/$basearch',
)}
it { is_expected.to contain_package('passenger') }
end

context 'manage_repo => false' do
let(:facts) { { operatingsystem: operatingsystem, osfamily: 'RedHat', operatingsystemmajrelease: '7' } }
let(:params) { { manage_repo: false } }
Expand Down

0 comments on commit ad8397d

Please sign in to comment.