Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/nginx/manifests/init.pp

Issue 29370627: Issue 4733 - Refactor nginx module (Closed)
Patch Set: Created Jan. 2, 2017, 11:46 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Vagrantfile ('k') | modules/nginx/templates/apt.key.erb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/nginx/manifests/init.pp
===================================================================
--- a/modules/nginx/manifests/init.pp
+++ b/modules/nginx/manifests/init.pp
@@ -10,25 +10,44 @@
# the inclusion here became necessary.
include ssh
- apt::ppa {'ppa:nginx/stable':
- }
-
- apt::source {'nginx':
- ensure => 'absent',
+ package {'nginx':
+ ensure => 'latest',
}
- exec {'purge-nginx':
- command => '/usr/bin/apt-get -y purge nginx',
- logoutput => true,
- path => '/usr/sbin:/usr/bin:/sbin:/bin',
- refreshonly => true,
- returns => [0, 100],
- subscribe => Apt::Ppa['ppa:nginx/stable'],
+ if $::lsbdistcodename == 'precise' {
+
+ apt::ppa {'ppa:nginx/stable':
+ }
+
+ apt::source {'nginx':
+ ensure => 'absent',
+ }
+
+ exec {'purge-nginx':
+ before => Package['nginx'],
+ command => '/usr/bin/apt-get -y purge nginx',
+ logoutput => true,
+ path => '/usr/sbin:/usr/bin:/sbin:/bin',
+ refreshonly => true,
+ returns => [0, 100],
+ subscribe => Apt::Ppa['ppa:nginx/stable'],
+ }
}
- package {'nginx':
- ensure => '1.10.1-3+precise3',
- require => Exec['purge-nginx'],
+ if $::operatingsystem == 'Debian' {
+
+ apt::key {'nginx':
+ key => 'ABF5BD827BD9BF62',
+ key_content => template('nginx/apt.key.erb'),
+ }
+
+ apt::source {'nginx':
+ before => Package['nginx'],
+ location => 'http://nginx.org/packages/mainline/debian/',
Fred 2017/01/03 15:09:46 Since we added "apt-transport-https" in the Vagran
f.lopez 2017/01/03 16:34:24 Nice catch, ack
+ release => downcase($::lsbdistcodename),
+ repos => 'nginx',
+ require => Apt::Key['nginx'],
+ }
}
user {'nginx':
« no previous file with comments | « Vagrantfile ('k') | modules/nginx/templates/apt.key.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld