module-nginx/manifests/package/debian.pp
Matthew Haughton d57729d733 package/debian: use more puppetlabs-apt features
* puppetlabs-apt does an APT update after every apt::source is added, so no
  need to do it again in this module.
* Use the 'required_packages' feature of apt::source instead of
  ensure_resources
2014-12-10 21:23:04 -05:00

60 lines
1.5 KiB
Puppet

# Class: nginx::package::debian
#
# This module manages NGINX package installation on debian based systems
#
# Parameters:
#
# There are no default parameters for this class.
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# This class file is not called directly
class nginx::package::debian(
$manage_repo = true,
$package_name = 'nginx',
$package_source = 'nginx',
$package_ensure = 'present'
) {
$distro = downcase($::operatingsystem)
package { 'nginx':
ensure => $package_ensure,
name => $package_name,
}
if $manage_repo {
include '::apt'
Exec['apt_update'] -> Package['nginx']
case $package_source {
'nginx': {
apt::source { 'nginx':
location => "http://nginx.org/packages/${distro}",
repos => 'nginx',
key => '7BD9BF62',
key_source => 'http://nginx.org/keys/nginx_signing.key',
}
}
'passenger': {
apt::source { 'nginx':
location => 'https://oss-binaries.phusionpassenger.com/apt/passenger',
repos => 'main',
key => '561F9B9CAC40B2F7',
key_source => 'https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt',
required_packages => 'apt-transport-https',
}
package { 'passenger':
ensure => 'present',
require => Exec['apt_update'],
}
}
default: {}
}
}
}