Merge pull request #57 from ktham/master
Use official nginx apt repo of stable releases for debian/ubuntu
This commit is contained in:
commit
349ae7debc
1 changed files with 30 additions and 0 deletions
|
@ -14,7 +14,37 @@
|
|||
#
|
||||
# This class file is not called directly
|
||||
class nginx::package::debian {
|
||||
$operatingsystem_lowercase = inline_template('<%= operatingsystem.downcase %>')
|
||||
|
||||
package { 'nginx':
|
||||
ensure => present,
|
||||
require => Anchor['nginx::apt_repo'],
|
||||
}
|
||||
|
||||
anchor { 'nginx::apt_repo' : }
|
||||
|
||||
file { '/etc/apt/sources.list.d/nginx.list':
|
||||
ensure => present,
|
||||
content => "deb http://nginx.org/packages/${operatingsystem_lowercase}/ ${::lsbdistcodename} nginx
|
||||
deb-src http://nginx.org/packages/${operatingsystem_lowercase}/ ${::lsbdistcodename} nginx
|
||||
",
|
||||
mode => '0444',
|
||||
require => Exec['add_nginx_apt_key'],
|
||||
before => Anchor['nginx::apt_repo'],
|
||||
}
|
||||
|
||||
exec { 'add_nginx_apt_key':
|
||||
command => "/usr/bin/wget http://nginx.org/keys/nginx_signing.key -O - | /usr/bin/apt-key add -",
|
||||
unless => '/usr/bin/apt-key list | /bin/grep -q nginx',
|
||||
before => Anchor['nginx::apt_repo'],
|
||||
}
|
||||
|
||||
exec { 'apt_get_update_for_nginx':
|
||||
command => '/usr/bin/apt-get update',
|
||||
timeout => 240,
|
||||
returns => [ 0, 100 ],
|
||||
refreshonly => true,
|
||||
subscribe => File['/etc/apt/sources.list.d/nginx.list'],
|
||||
before => Anchor['nginx::apt_repo'],
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue