deprec 2.1.4 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,12 @@
1
1
  # deprec changelog
2
2
 
3
+ = 2.1.5 (Dec 3, 2009)
4
+
5
+ * collectd-4.8.1
6
+ * haproxy-1.3.22
7
+ * monit-5.0.3
8
+ * don't install vim-full as it installs gnome
9
+
3
10
  = 2.1.4 (Sep 16, 2009)
4
11
 
5
12
  * rubygems-1.3.5
@@ -71,7 +71,7 @@ module Deprec2
71
71
  # render to remote machine
72
72
  puts 'You need to specify a path to render the template to!' unless path
73
73
  exit unless path
74
- sudo "test -d #{File.dirname(path)} || sudo mkdir -p #{File.dirname(path)}"
74
+ sudo "test -d #{File.dirname(path)} || #{sudo} mkdir -p #{File.dirname(path)}"
75
75
  std.su_put rendered_template, path, '/tmp/', :mode => mode
76
76
  sudo "chown #{owner} #{path}" if defined?(owner)
77
77
  elsif path
@@ -170,7 +170,7 @@ module Deprec2
170
170
  else
171
171
  full_remote_path = file[:path]
172
172
  end
173
- sudo "test -d #{File.dirname(full_remote_path)} || sudo mkdir -p #{File.dirname(full_remote_path)}"
173
+ sudo "test -d #{File.dirname(full_remote_path)} || #{sudo} mkdir -p #{File.dirname(full_remote_path)}"
174
174
  std.su_put File.read(full_local_path), full_remote_path, '/tmp/', :mode=>file[:mode]
175
175
  sudo "chown #{file[:owner]} #{full_remote_path}"
176
176
  else
@@ -205,7 +205,7 @@ module Deprec2
205
205
  switches += " --shell=#{options[:shell]} " if options[:shell]
206
206
  switches += ' --create-home ' unless options[:homedir] == false
207
207
  switches += " --gid #{options[:group]} " unless options[:group].nil?
208
- invoke_command "grep '^#{user}:' /etc/passwd || sudo /usr/sbin/useradd #{switches} #{user}",
208
+ invoke_command "grep '^#{user}:' /etc/passwd || #{sudo} /usr/sbin/useradd #{switches} #{user}",
209
209
  :via => run_method
210
210
  end
211
211
 
@@ -213,12 +213,12 @@ module Deprec2
213
213
  def groupadd(group, options={})
214
214
  via = options.delete(:via) || run_method
215
215
  # XXX I don't like specifying the path to groupadd - need to sort out paths before long
216
- invoke_command "grep '#{group}:' /etc/group || sudo /usr/sbin/groupadd #{group}", :via => via
216
+ invoke_command "grep '#{group}:' /etc/group || #{sudo} /usr/sbin/groupadd #{group}", :via => via
217
217
  end
218
218
 
219
219
  # add group to the list of groups this user belongs to
220
220
  def add_user_to_group(user, group)
221
- invoke_command "groups #{user} | grep ' #{group} ' || sudo /usr/sbin/usermod -G #{group} -a #{user}",
221
+ invoke_command "groups #{user} | grep ' #{group} ' || #{sudo} /usr/sbin/usermod -G #{group} -a #{user}",
222
222
  :via => run_method
223
223
  end
224
224
 
@@ -12,8 +12,8 @@ Capistrano::Configuration.instance(:must_exist).load do
12
12
  # Copy collection-php to /var/www/collectd
13
13
 
14
14
  SRC_PACKAGES[:collectd] = {
15
- :url => "http://collectd.org/files/collectd-4.7.2.tar.gz",
16
- :md5sum => "893c7a861b7a4a591188d9468622d89d collectd-4.7.2.tar.gz",
15
+ :url => "http://collectd.org/files/collectd-4.8.1.tar.gz",
16
+ :md5sum => "7e85183a129b566383e65332d2b863c5 collectd-4.8.1.tar.gz",
17
17
  :configure => "./configure --prefix=/usr/local;"
18
18
  }
19
19
 
@@ -11,6 +11,7 @@ Capistrano::Configuration.instance(:must_exist).load do
11
11
  desc "Install mysql"
12
12
  task :install, :roles => :db do
13
13
  install_deps
14
+ config
14
15
  start
15
16
  # symlink_mysql_sockfile # XXX still needed?
16
17
  end
@@ -20,13 +21,6 @@ Capistrano::Configuration.instance(:must_exist).load do
20
21
  apt.install( {:base => %w(mysql-server mysql-client libmysqlclient15-dev)}, :stable )
21
22
  end
22
23
 
23
- # task :symlink_mysql_sockfile, :roles => :db do
24
- # # rails puts "socket: /tmp/mysql.sock" into config/database.yml
25
- # # this is not the location for our ubuntu's mysql socket file
26
- # # so we create this link to make deployment using rails defaults simpler
27
- # sudo "ln -sf /var/run/mysqld/mysqld.sock /tmp/mysql.sock"
28
- # end
29
-
30
24
  # Configuration
31
25
 
32
26
  SYSTEM_CONFIG_FILES[:mysql] = [
@@ -47,6 +41,7 @@ Capistrano::Configuration.instance(:must_exist).load do
47
41
  desc "Push mysql config files to server"
48
42
  task :config, :roles => :db do
49
43
  deprec2.push_configs(:mysql, SYSTEM_CONFIG_FILES[:mysql])
44
+ reload
50
45
  end
51
46
 
52
47
  task :activate, :roles => :db do
@@ -4,8 +4,8 @@ Capistrano::Configuration.instance(:must_exist).load do
4
4
  namespace :haproxy do
5
5
 
6
6
  SRC_PACKAGES[:haproxy] = {
7
- :md5sum => "e37046e0cb2f407d92c41d7731d1dd10 haproxy-1.3.20.tar.gz",
8
- :url => "http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.20.tar.gz"
7
+ :md5sum => "b84e0935cfea99eda43645d53bb82367 haproxy-1.3.22.tar.gz",
8
+ :url => "http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.22.tar.gz"
9
9
  }
10
10
 
11
11
  desc "Install haproxy"
@@ -30,17 +30,8 @@ Capistrano::Configuration.instance(:must_exist).load do
30
30
  # Upstream changes: http://www.tildeslash.com/monit/dist/CHANGES.txt
31
31
  # Ubuntu package version = monit-4.8.1
32
32
  SRC_PACKAGES[:monit] = {
33
- :filename => 'monit-4.10.1.tar.gz',
34
- :md5sum => "d3143b0bbd79b53f1b019d2fc1dae656 monit-4.10.1.tar.gz",
35
- :dir => 'monit-4.10.1',
36
- :url => "http://www.tildeslash.com/monit/dist/monit-4.10.1.tar.gz",
37
- :unpack => "tar zxf monit-4.10.1.tar.gz;",
38
- :configure => %w(
39
- ./configure
40
- ;
41
- ).reject{|arg| arg.match '#'}.join(' '),
42
- :make => 'make;',
43
- :install => 'make install;'
33
+ :md5sum => "dae7859ec10551fc941daeae60dee9d3 monit-5.0.3.tar.gz",
34
+ :url => "http://mmonit.com/monit/dist/monit-5.0.3.tar.gz"
44
35
  }
45
36
 
46
37
  desc "Install monit"
@@ -49,34 +49,58 @@ Capistrano::Configuration.instance(:must_exist).load do
49
49
  end
50
50
  }
51
51
 
52
- SYSTEM_CONFIG_FILES[:network] = [
52
+ # Non standard deprec!
53
+ #
54
+ # I might move to making this standard in future. It makes it easier to
55
+ # override individual config files in local recipes. - Mike
56
+ #
57
+ SYSTEM_CONFIG_FILES[:network] = {
53
58
 
54
- {:template => "interfaces.erb",
55
- :path => '/etc/network/interfaces',
56
- :mode => 0644,
57
- :owner => 'root:root'},
58
-
59
- {:template => "hosts.erb",
60
- :path => '/etc/hosts',
61
- :mode => 0644,
62
- :owner => 'root:root'},
59
+ :interfaces => {
60
+ :template => "interfaces.erb",
61
+ :path => '/etc/network/interfaces',
62
+ :mode => 0644,
63
+ :owner => 'root:root',
64
+ :remote => true
65
+ },
66
+
67
+ :hosts => {
68
+ :template => "hosts.erb",
69
+ :path => '/etc/hosts',
70
+ :mode => 0644,
71
+ :owner => 'root:root',
72
+ :remote => true
73
+ },
63
74
 
64
- {:template => "hostname.erb",
65
- :path => '/etc/hostname',
66
- :mode => 0644,
67
- :owner => 'root:root'},
75
+ :hostname => {
76
+ :template => "hostname.erb",
77
+ :path => '/etc/hostname',
78
+ :mode => 0644,
79
+ :owner => 'root:root',
80
+ :remote => true
81
+ },
68
82
 
69
- {:template => "resolv.conf.erb",
70
- :path => '/etc/resolv.conf',
71
- :mode => 0644,
72
- :owner => 'root:root'}
83
+ :resolv => {
84
+ :template => "resolv.conf.erb",
85
+ :path => '/etc/resolv.conf',
86
+ :mode => 0644,
87
+ :owner => 'root:root',
88
+ :remote => true
89
+ }
90
+ }
73
91
 
74
- ]
75
-
92
+
93
+ SYSTEM_CONFIG_FILES[:network].each do |file, details|
94
+ desc "Generate and push #{details[:path]}"
95
+ task file.to_sym do
96
+ deprec2.render_template(:network, details)
97
+ end
98
+ end
99
+
76
100
  # XXX need to set the order for these as it breaks sudo currently
77
101
  desc "Update system networking configuration"
78
102
  task :config do
79
- SYSTEM_CONFIG_FILES[:network].each do |file|
103
+ SYSTEM_CONFIG_FILES[:network].values.each do |file|
80
104
  deprec2.render_template(:network, file.merge(:remote=>true))
81
105
  end
82
106
  end
@@ -85,9 +109,8 @@ Capistrano::Configuration.instance(:must_exist).load do
85
109
  task :restart do
86
110
  sudo '/etc/init.d/networking restart'
87
111
  end
88
-
89
-
112
+
90
113
  end
91
114
  end
92
115
 
93
- end
116
+ end
@@ -41,7 +41,7 @@ Capistrano::Configuration.instance(:must_exist).load do
41
41
 
42
42
  desc "Install some useful utils"
43
43
  task :other do
44
- apps = %w(lsof vim-full tree psmisc screen)
44
+ apps = %w(lsof vim tree psmisc screen)
45
45
  apt.install( {:base => apps}, :stable )
46
46
  end
47
47
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Bailey
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-16 00:00:00 +10:00
12
+ date: 2009-12-03 00:00:00 +11:00
13
13
  default_executable: depify
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency