provizioning 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,11 +34,6 @@ apt-get -y upgrade
34
34
  # Install essential stuff ...
35
35
  ##############################################################################
36
36
 
37
- apt-get -y install python-software-properties
38
- add-apt-repository ppa:pitti/postgresql
39
- add-apt-repository ppa:nginx/stable
40
- #10gen key
41
- apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
42
37
  apt-get update
43
38
  apt-get -y install build-essential
44
39
  apt-get -y install git-core
@@ -1,3 +1,3 @@
1
1
  module Provizioning
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -52,7 +52,7 @@ class mongo {
52
52
  }
53
53
 
54
54
  package {"mongodb-10gen":
55
- ensure => "2.0.2",
55
+ ensure => "2.0.3",
56
56
  require => [Exec["update apt to find mongodb"], File["/etc/mongodb.conf"]]
57
57
  }
58
58
  }
@@ -21,6 +21,7 @@
21
21
  #
22
22
 
23
23
  class nginx {
24
+ include "nginx::$operatingsystem"
24
25
 
25
26
  $nginx_includes = "/etc/nginx/includes"
26
27
  $nginx_conf = "/etc/nginx/conf.d"
@@ -32,12 +33,36 @@ class nginx {
32
33
  if ! defined(Package['nginx']) { package { nginx: ensure => installed }}
33
34
 
34
35
  service { nginx:
35
- ensure => running,
36
- enable => true,
36
+ ensure => running,
37
+ enable => true,
37
38
  hasrestart => true,
38
- require => File["/etc/nginx/nginx.conf"],
39
+ require => [File["/etc/nginx/nginx.conf"], File["/etc/apt/sources.list.d/nginx.list"]],
39
40
  }
40
41
 
42
+ class ubuntu {
43
+ include apt
44
+
45
+ exec {"get-nginx-apt-key":
46
+ command => "apt-key adv --keyserver keyserver.ubuntu.com --recv C300EE8C"
47
+ }
48
+
49
+ file {"/etc/apt/sources.list.d/nginx.list":
50
+ ensure => present,
51
+ owner => root,
52
+ group => root,
53
+ content => $operatingsystemrelease ? {
54
+ '10.04' => 'deb http://ppa.launchpad.net/nginx/stable/ubuntu lucid main',
55
+ '11.04' => 'deb http://ppa.launchpad.net/nginx/stable/ubuntu natty main',
56
+ },
57
+ require => Exec["get-nginx-apt-key"],
58
+ }
59
+
60
+ exec {"update apt to find nginx":
61
+ command => "/usr/bin/apt-get -y update",
62
+ require => File["/etc/apt/sources.list.d/nginx.list"],
63
+ }
64
+ }
65
+
41
66
  file { "/etc/nginx/nginx.conf":
42
67
  ensure => present,
43
68
  mode => 644,
@@ -46,7 +71,7 @@ class nginx {
46
71
  content => template("nginx/nginx.conf.erb"),
47
72
  notify => Exec["reload-nginx"],
48
73
  require => Package["nginx"],
49
- }
74
+ }
50
75
 
51
76
  file { $nginx_conf:
52
77
  ensure => directory,
@@ -81,8 +106,8 @@ class nginx {
81
106
 
82
107
  exec { "reload-nginx":
83
108
  command => "/etc/init.d/nginx reload",
84
- refreshonly => true,
85
- }
109
+ refreshonly => true,
110
+ }
86
111
 
87
112
  # Define: nginx::config
88
113
  #
@@ -119,7 +144,7 @@ class nginx {
119
144
  # * ensure: typically set to "present" or "absent". Defaults to "present"
120
145
  # * content: site definition (should be a template).
121
146
  #
122
- define site ( $ensure = 'present', $content = '' ) {
147
+ define site($ensure = 'present', $content = '') {
123
148
  case $ensure {
124
149
  'present' : {
125
150
  nginx::install_site { $name:
@@ -143,7 +168,7 @@ class nginx {
143
168
  # Install nginx vhost
144
169
  # This definition is private, not intended to be called directly
145
170
  #
146
- define install_site ($content = '' ) {
171
+ define install_site($content = '' ) {
147
172
  # first, make sure the site config exists
148
173
  case $content {
149
174
  '': {
@@ -200,6 +225,4 @@ class nginx {
200
225
  notify => Exec["reload-nginx"],
201
226
  }
202
227
  }
203
-
204
-
205
228
  }
@@ -13,6 +13,8 @@
13
13
  # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14
14
 
15
15
  class postgres {
16
+ include "postgres::$operatingsystem"
17
+
16
18
  package { [postgresql]: ensure => installed }
17
19
  package { [libpq-dev]: ensure => installed }
18
20
 
@@ -20,6 +22,31 @@ class postgres {
20
22
  ensure => running,
21
23
  enable => true,
22
24
  hasstatus => true,
23
- subscribe => [Package[postgresql]]
25
+ subscribe => [Package[postgresql]],
26
+ require => [File['/etc/apt/sources.list.d/postgres.list']]
27
+ }
28
+
29
+ class ubuntu {
30
+ include apt
31
+
32
+ exec {"get-postgres-apt-key":
33
+ command => "apt-key adv --keyserver keyserver.ubuntu.com --recv 8683D8A2"
34
+ }
35
+
36
+ file {"/etc/apt/sources.list.d/postgres.list":
37
+ ensure => present,
38
+ owner => root,
39
+ group => root,
40
+ content => $operatingsystemrelease ? {
41
+ '10.04' => 'deb http://ppa.launchpad.net/pitti/postgresql/ubuntu lucid main',
42
+ '11.04' => 'deb http://ppa.launchpad.net/pitti/postgresql/ubuntu natty main',
43
+ },
44
+ require => Exec["get-postgres-apt-key"],
45
+ }
46
+
47
+ exec {"update apt to find postgres":
48
+ command => '/usr/bin/apt-get -y update',
49
+ require => File['/etc/apt/sources.list.d/postgres.list'],
50
+ }
24
51
  }
25
52
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: provizioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-13 00:00:00.000000000 Z
12
+ date: 2012-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &70346636664320 !ruby/object:Gem::Requirement
16
+ requirement: &70318656139260 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70346636664320
24
+ version_requirements: *70318656139260
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: capistrano-ext
27
- requirement: &70346636663180 !ruby/object:Gem::Requirement
27
+ requirement: &70318656138240 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70346636663180
35
+ version_requirements: *70318656138240
36
36
  description: Puppet server provisioning tools, recipes and templates
37
37
  email:
38
38
  - victor.castell@season.es