le1t0-deprec 2.1.6.086 → 2.1.6.087

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,7 @@ Capistrano::Configuration.instance(:must_exist).load do
22
22
 
23
23
  set :glusterfs_defaults, { }
24
24
  set :glusterfs_exports, { }
25
+ set :glusterfs_client_config_local, false
25
26
 
26
27
  SRC_PACKAGES[:glusterfs] = {
27
28
  :md5sum => "e2eaf3d1e7a735ee7e7b262a46bbc75d glusterfs-3.0.4.tar.gz",
@@ -51,7 +52,18 @@ Capistrano::Configuration.instance(:must_exist).load do
51
52
 
52
53
  desc "Generate configuration file(s) for Glusterfs from template(s)"
53
54
  task :config_gen do
54
- SYSTEM_CONFIG_FILES[:glusterfs].each do |file|
55
+ system_config_files = SYSTEM_CONFIG_FILES[:glusterfs].dup
56
+ if glusterfs_client_config_local
57
+ glusterfs_exports.each do |name, cfg|
58
+ system_config_files << {
59
+ :template => "glusterfs.vol.erb",
60
+ :path => "/etc/glusterfs/#{name}-#{cfg[:transport] || glusterfs_defaults[:transport] || 'tcp'}.vol",
61
+ :mode => 0644,
62
+ :owner => 'root:root'
63
+ }
64
+ end
65
+ end
66
+ system_config_files.each do |file|
55
67
  deprec2.render_template(:glusterfs, file)
56
68
  end
57
69
  end
@@ -65,9 +77,22 @@ Capistrano::Configuration.instance(:must_exist).load do
65
77
  desc "Create glusterfs client config files on server"
66
78
  task :config_client, :roles => :storage_client do
67
79
  sudo "mkdir -p /etc/glusterfs 2>/dev/null || exit 0"
68
- glusterfs_generate_volfiles(glusterfs_exports, glusterfs_defaults) do |temp_dir, name, cfg|
69
- sudo "mkdir -p #{cfg[:mount_dir] || glusterfs_defaults[:mount_dir]}"
70
- sudo "mv #{temp_dir}/#{name}-#{cfg[:transport] || glusterfs_defaults[:transport] || 'tcp'}.vol /etc/glusterfs/"
80
+ if glusterfs_client_config_local
81
+ system_config_files = [] # we can start empty, as we don't need the init file on the clients
82
+ glusterfs_exports.each do |name, cfg|
83
+ system_config_files << {
84
+ :template => "glusterfs.vol.erb",
85
+ :path => "/etc/glusterfs/#{name}-#{cfg[:transport] || glusterfs_defaults[:transport] || 'tcp'}.vol",
86
+ :mode => 0644,
87
+ :owner => 'root:root'
88
+ }
89
+ end
90
+ deprec2.push_configs(:glusterfs, system_config_files)
91
+ else
92
+ glusterfs_generate_volfiles(glusterfs_exports, glusterfs_defaults) do |temp_dir, name, cfg|
93
+ sudo "mkdir -p #{cfg[:mount_dir] || glusterfs_defaults[:mount_dir]}"
94
+ sudo "mv #{temp_dir}/#{name}-#{cfg[:transport] || glusterfs_defaults[:transport] || 'tcp'}.vol /etc/glusterfs/"
95
+ end
71
96
  end
72
97
  end
73
98
 
File without changes
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: le1t0-deprec
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.1.6.086
5
+ version: 2.1.6.087
6
6
  platform: ruby
7
7
  authors:
8
8
  - Le1t0
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-27 00:00:00 Z
13
+ date: 2011-07-30 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: le1t0-capistrano
@@ -134,6 +134,7 @@ files:
134
134
  - lib/deprec/templates/ddclient/ddclient.erb
135
135
  - lib/deprec/templates/deprec/caprc.erb
136
136
  - lib/deprec/templates/drbd/drbd.conf.erb
137
+ - lib/deprec/templates/glusterfs/glusterfs.vol.erb
137
138
  - lib/deprec/templates/glusterfs/glusterfsd-init.erb
138
139
  - lib/deprec/templates/gnbd_client/cluster.conf.erb
139
140
  - lib/deprec/templates/gnbd_client/clvm-default.erb