chef-vpc-toolkit 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ * Thu Feb 15 2011 Dan Prince <dan.prince@rackspace.com> - 2.3.0
2
+ - Support for setting server group VPN device (tap/tun)
3
+ - Fix issue where chef client would occasionally not start on Ubuntu.
4
+ - Use regex's instead of start_with? (support Ruby 1.8.6)
5
+
1
6
  * Thu Feb 6 2011 Dan Prince <dan.prince@rackspace.com> - 2.2.0
2
7
  - Support command execution with 'rake ssh'.
3
8
  - The 'chef:tail_logs' task now supports the SERVER_NAME variable.
@@ -7,7 +12,6 @@
7
12
  - Implement 'group:delete_server' task.
8
13
  - Implement 'group:list REMOTE=true' task.
9
14
  - Implement 'group:join' task.
10
- - Implement 'group:join' task.
11
15
  - Update the 'chef:install' task to support the SERVER_NAME variable.
12
16
  - The 'chef:sync_repos' task is now 'chef:push_repos'.
13
17
  - Implement a 'chef:pull_repos' task.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.0
1
+ 2.3.0
@@ -26,6 +26,7 @@ if ! dpkg -L chef &> /dev/null; then
26
26
 
27
27
  /etc/init.d/chef-client stop &> /dev/null
28
28
  sleep 2
29
+ kill -9 $(pgrep chef-client) || true
29
30
  rm /var/log/chef/client.log
30
31
 
31
32
  fi
@@ -42,7 +42,7 @@ MULTI_PART_BOUNDARY="jtZ!pZ1973um"
42
42
 
43
43
  if ssl_key then
44
44
  pkey_data=IO.read(ssl_key)
45
- if pkey_data.start_with?("-----BEGIN RSA PRIVATE KEY-----")
45
+ if pkey_data =~ /^-----BEGIN RSA PRIVATE KEY-----/
46
46
  @@http.key=OpenSSL::PKey::RSA.new(pkey_data)
47
47
  else
48
48
  @@http.key=OpenSSL::PKey::DSA.new(pkey_data)
@@ -26,6 +26,7 @@ class ServerGroup
26
26
  attr_accessor :name
27
27
  attr_accessor :description
28
28
  attr_accessor :domain_name
29
+ attr_accessor :vpn_device
29
30
  attr_accessor :vpn_network
30
31
  attr_accessor :vpn_subnet
31
32
  attr_accessor :owner_name
@@ -37,6 +38,7 @@ class ServerGroup
37
38
  @name=options[:name]
38
39
  @description=options[:description]
39
40
  @domain_name=options[:domain_name]
41
+ @vpn_device=options[:vpn_device] or @vpn_device="tun"
40
42
  @vpn_network=options[:vpn_network] or @vpn_network="172.19.0.0"
41
43
  @vpn_subnet=options[:vpn_subnet] or @vpn_subnet="255.255.128.0"
42
44
  @owner_name=options[:owner_name] or @owner_name=ENV['USER']
@@ -74,6 +76,7 @@ class ServerGroup
74
76
  :name => json_hash["name"],
75
77
  :description => json_hash["description"],
76
78
  :domain_name => json_hash["domain_name"],
79
+ :vpn_device => json_hash["vpn_device"],
77
80
  :vpn_network => json_hash["vpn_network"],
78
81
  :vpn_subnet => json_hash["vpn_subnet"]
79
82
  )
@@ -107,6 +110,7 @@ class ServerGroup
107
110
  sg.description(@description)
108
111
  sg.tag! "owner-name", @owner_name
109
112
  sg.tag! "domain-name", @domain_name
113
+ sg.tag! "vpn-device", @vpn_device
110
114
  sg.tag! "vpn-network", @vpn_network
111
115
  sg.tag! "vpn-subnet", @vpn_subnet
112
116
  sg.servers("type" => "array") do |xml_servers|
@@ -152,6 +156,7 @@ class ServerGroup
152
156
  :id => XMLUtil.element_text(sg_xml, "id").to_i,
153
157
  :domain_name => XMLUtil.element_text(sg_xml, "domain-name"),
154
158
  :description => XMLUtil.element_text(sg_xml, "description"),
159
+ :vpn_device => XMLUtil.element_text(sg_xml, "vpn-device"),
155
160
  :vpn_network => XMLUtil.element_text(sg_xml, "vpn-network"),
156
161
  :vpn_subnet => XMLUtil.element_text(sg_xml, "vpn-subnet")
157
162
  )
@@ -167,6 +167,14 @@ module VpnNetworkManager
167
167
  value.string("yes")
168
168
  end
169
169
  end
170
+ if group.vpn_device == "tap"
171
+ entrylist.entry do |entry|
172
+ entry.key("vpn/tap-dev")
173
+ entry.value do |value|
174
+ value.string("yes")
175
+ end
176
+ end
177
+ end
170
178
  entrylist.entry do |entry|
171
179
  entry.key("vpn/remote")
172
180
  entry.value do |value|
@@ -341,7 +341,7 @@ task :ssh => 'group:init' do
341
341
 
342
342
  sg=ServerGroup.fetch(:source => "cache")
343
343
  args=ARGV[1, ARGV.length].join(" ")
344
- if ARGV[1] and ARGV[1].start_with?('GROUP_ID=')
344
+ if ARGV[1] and ARGV[1] =~ /^GROUP_ID=/
345
345
  args=ARGV[2, ARGV.length].join(" ")
346
346
  end
347
347
  exec("ssh -o \"StrictHostKeyChecking no\" root@#{sg.vpn_gateway_ip} #{args}")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-vpc-toolkit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 2.2.0
10
+ version: 2.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Prince
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-06 00:00:00 -05:00
18
+ date: 2011-02-16 00:00:00 -05:00
19
19
  default_executable: chef-vpc-toolkit
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency