murakumo 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ # An order of addrinfo follows the returned order. (for EC2)
2
+ scopev4 ::ffff:10.152.43.33/104 2
File without changes
data/lib/cli/mrkmctl.rb CHANGED
@@ -28,6 +28,8 @@ begin
28
28
  'Origin'
29
29
  when Murakumo::MASTER
30
30
  'Master'
31
+ when Murakumo::SECONDARY
32
+ 'Secondary'
31
33
  else
32
34
  'Backup'
33
35
  end
@@ -9,7 +9,7 @@ def mrkmctl_parse_args
9
9
  desc 'displays a list of a record'
10
10
  option :list, '-L', '--list [SEARCH_PHRASE]'
11
11
 
12
- desc 'adds or updates a record: <hostname>[,<TTL>[,{master|backup}]]'
12
+ desc 'adds or updates a record: <hostname>[,<TTL>[,{master|secondary|backup}]]'
13
13
  option :add, '-A', '--add RECORD', :type => Array, :multiple => true do |value|
14
14
  (1 <= value.length and value.length <= 3) or invalid_argument
15
15
 
@@ -25,7 +25,7 @@ def mrkmctl_parse_args
25
25
  end
26
26
 
27
27
  # Priority
28
- priority.nil? or /\A(master|backup)\Z/i =~ priority or invalid_argument
28
+ priority.nil? or /\A(master|secondary|backup)\Z/i =~ priority or invalid_argument
29
29
  end
30
30
 
31
31
  desc 'deletes a record'
@@ -85,6 +85,8 @@ def mrkmctl_parse_args
85
85
  priority = case r[2].to_s
86
86
  when /master/i
87
87
  Murakumo::MASTER
88
+ when /secondary/i
89
+ Murakumo::SECONDARY
88
90
  else
89
91
  Murakumo::BACKUP
90
92
  end
@@ -47,7 +47,7 @@ def murakumo_parse_args
47
47
  end
48
48
  end # :host
49
49
 
50
- desc 'resource record of an alias: <hostname>[,<TTL>[,{master|backup}]]'
50
+ desc 'resource record of an alias: <hostname>[,<TTL>[,{master|secondary|backup}]]'
51
51
  option :aliases, '-A', '--alias RECORD', :type => Array, :multiple => true do |value|
52
52
  (1 <= value.length and value.length <= 3) or invalid_argument
53
53
 
@@ -63,7 +63,7 @@ def murakumo_parse_args
63
63
  end
64
64
 
65
65
  # Priority
66
- priority.nil? or /\A(master|backup)\Z/i =~ priority or invalid_argument
66
+ priority.nil? or /\A(master|secondary|backup)\Z/i =~ priority or invalid_argument
67
67
  end # :aliases
68
68
 
69
69
  desc 'ip address of a default resolver'
@@ -155,6 +155,8 @@ def murakumo_parse_args
155
155
  priority = case r[2].to_s
156
156
  when /master/i
157
157
  Murakumo::MASTER
158
+ when /secondary/i
159
+ Murakumo::SECONDARY
158
160
  else
159
161
  Murakumo::BACKUP
160
162
  end
@@ -1,8 +1,9 @@
1
1
  module Murakumo
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
 
4
4
  # Priority
5
5
  MASTER = 1
6
+ SECONDARY = 0
6
7
  BACKUP = -1
7
8
  ORIGIN = -65536
8
9
 
@@ -382,6 +382,9 @@ module Murakumo
382
382
  # 優先度の高いレコードを検索
383
383
  records = shuffle_records(@address_records.select {|i| i['priority'] == MASTER })
384
384
 
385
+ # 次に優先度の高いレコードを検索
386
+ records.concat(shuffle_records(@address_records.select {|i| i['priority'] == SECONDARY }))
387
+
385
388
  # レコードが見つからなかった場合はバックアップを選択
386
389
  if records.empty?
387
390
  records = shuffle_records(@address_records.select {|i| i['priority'] == BACKUP })
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: murakumo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - winebarrel
@@ -106,7 +106,8 @@ files:
106
106
  - lib/srv/murakumo_cloud.rb
107
107
  - lib/misc/murakumo_const.rb
108
108
  - etc/murakumo-update-config-for-ec2
109
- - etc/murakumo.yml.sample
109
+ - etc/gai.conf.example
110
+ - etc/murakumo.yml.example
110
111
  - etc/dhclient-script.patch
111
112
  - etc/murakumo.server
112
113
  homepage: https://bitbucket.org/winebarrel/murakumo