Index: modules/nginx/manifests/init.pp |
diff --git a/modules/nginx/manifests/init.pp b/modules/nginx/manifests/init.pp |
index ed5f3b9c0e4b260b7445f17dcf8ddbd4ba1484fb..04e1db48a8a08fa7a6c91b65d80fe49d6e21c597 100644 |
--- a/modules/nginx/manifests/init.pp |
+++ b/modules/nginx/manifests/init.pp |
@@ -11,15 +11,18 @@ class nginx ( |
ensure => 'absent', |
} |
- # Ensures that nginx is not installed from the Ubuntu sources |
- package {'nginx-common': |
- ensure => purged, |
- before => Package['nginx'] |
+ 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'], |
} |
package {'nginx': |
ensure => '1.8.0-1+precise1', |
- require => Apt::Ppa['ppa:nginx/stable'], |
+ require => Exec['purge-nginx'], |
} |
File { |
@@ -110,7 +113,7 @@ class nginx ( |
if $is_default { |
$default_conf = '/etc/nginx/sites-enabled/default' |
ensure_resource('file', $default_conf, {ensure => 'absent'}) |
- File[$default_conf] ~> Service['nginx'] |
+ Package['nginx'] -> File[$default_conf] ~> Service['nginx'] |
} |
file {"/etc/nginx/sites-enabled/${domain}": |