Left: | ||
Right: |
OLD | NEW |
---|---|
1 class nginx ( | 1 class nginx ( |
2 $worker_processes = $nginx::params::worker_processes, | 2 $worker_processes = $nginx::params::worker_processes, |
3 $worker_connections = $nginx::params::worker_connections, | 3 $worker_connections = $nginx::params::worker_connections, |
4 $ssl_session_cache = $nginx::params::ssl_session_cache | 4 $ssl_session_cache = $nginx::params::ssl_session_cache |
5 ) inherits nginx::params { | 5 ) inherits nginx::params { |
6 | 6 |
7 include apt | |
8 | |
9 apt::source {'nginx': | |
10 location => "http://nginx.org/packages/ubuntu", | |
11 repos => "nginx", | |
12 key => "A524C53E", | |
13 key_source => "http://sysoev.ru/pgp.txt" | |
14 } | |
15 | |
7 package {'nginx': | 16 package {'nginx': |
8 ensure => present | 17 ensure => '1.4.1-1~precise', |
Wladimir Palant
2013/05/18 09:52:32
Will that also allow for newer versions?
Felix Dahlke
2013/05/21 05:40:58
No, this will install exactly this version. I've t
| |
18 require => Apt::Source['nginx'] | |
9 } | 19 } |
10 | 20 |
11 File { | 21 File { |
12 owner => root, | 22 owner => root, |
13 group => root, | 23 group => root, |
14 mode => 0644, | 24 mode => 0644, |
15 } | 25 } |
16 | 26 |
17 file {'/etc/nginx/nginx.conf': | 27 file {'/etc/nginx/nginx.conf': |
18 content => template('nginx/nginx.conf.erb'), | 28 content => template('nginx/nginx.conf.erb'), |
19 require => Package['nginx'], | 29 require => Package['nginx'], |
20 notify => Service['nginx'] | 30 notify => Service['nginx'] |
21 } | 31 } |
22 | 32 |
33 file {'/etc/nginx/sites-available': | |
34 ensure => directory, | |
35 require => Package['nginx'] | |
36 } | |
37 | |
38 file {'/etc/nginx/sites-enabled': | |
39 ensure => directory, | |
40 require => Package['nginx'] | |
41 } | |
42 | |
23 file {'/etc/nginx/sites-available/default': | 43 file {'/etc/nginx/sites-available/default': |
24 ensure => absent, | 44 ensure => absent, |
25 require => Package['nginx'] | 45 require => Package['nginx'] |
26 } | 46 } |
27 | 47 |
28 # file {'/etc/nginx/sites-enabled/default': | 48 # file {'/etc/nginx/sites-enabled/default': |
29 # ensure => absent, | 49 # ensure => absent, |
30 # } | 50 # } |
31 | 51 |
32 define hostconfig ($file = $title, $source, $enabled = false) { | 52 define hostconfig ($file = $title, $source, $enabled = false) { |
(...skipping 19 matching lines...) Expand all Loading... | |
52 } | 72 } |
53 | 73 |
54 service {'nginx': | 74 service {'nginx': |
55 ensure => running, | 75 ensure => running, |
56 enable => true, | 76 enable => true, |
57 restart => '/etc/init.d/nginx reload', | 77 restart => '/etc/init.d/nginx reload', |
58 hasstatus => true, | 78 hasstatus => true, |
59 require => File['/etc/nginx/nginx.conf'] | 79 require => File['/etc/nginx/nginx.conf'] |
60 } | 80 } |
61 } | 81 } |
OLD | NEW |