itamae-mitsurin 0.34 → 0.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64895e8dac9c6b5770237bcc9c89a487d2312ce8
4
- data.tar.gz: 8847a34c68ba45c2cb48b20dfd0ad3eae32fe050
3
+ metadata.gz: db9ad7a86446e88dc50ab91c861e38155c1350f6
4
+ data.tar.gz: 2fe613b6476780c81e5311e744101a487f729d8c
5
5
  SHA512:
6
- metadata.gz: 26bb54ef3e810c77298b1279b89e71bdd912b083cfaf5ac0782972ee1f892784bd3b2ea6ea84c7a241bed2bc7dc218c719d59f2874b96ce339251946793b96e0
7
- data.tar.gz: e4221a1a9662ef5e8a9dda4980c8ad2a97ab72b557888bb504647a05cf07697166d838132ce8a2af329748085ebeb43587a11984a438591b9bc1139a864e73d2
6
+ metadata.gz: 190496a48de3ddb5777a3004172495ebe4d390051d6fbe72be8545677ed2613ed278b80dee8d443c38f96c0da8fe1252b17976d5ac236605db9dd8dfd4d5c932
7
+ data.tar.gz: a7cdb00986b1a28f2e6619d10e6a0a4839e4af690253d3903aad8c49288eb5e0c61bb4434d9221234acce291483a5a14143144b9b4018f8b06df9ae7a081af15
@@ -10,10 +10,9 @@ module ItamaeMitsurin
10
10
  define_attribute :name, type: String, default_name: true
11
11
  define_attribute :hosted_zone_id, type: String, required: true
12
12
  define_attribute :type, type: String, required: true
13
- define_attribute :weight, type: Integer
14
13
  define_attribute :failover, type: String
15
14
  define_attribute :ttl, type: Integer
16
- define_attribute :value, type: String, required: true
15
+ define_attribute :value, type: [String, Array], required: true
17
16
  define_attribute :health_check_id, type: String
18
17
  define_attribute :traffic_policy_instance_id, type: String
19
18
 
@@ -46,7 +45,6 @@ module ItamaeMitsurin
46
45
  name: attributes.name,
47
46
  type: attributes.type,
48
47
  set_identifier: set_identifier,
49
- weight: attributes.weight,
50
48
  failover: attributes.failover,
51
49
  ttl: attributes.ttl,
52
50
  resource_records: [
@@ -62,13 +60,25 @@ module ItamaeMitsurin
62
60
  },
63
61
  }
64
62
 
63
+ resource_records = []
64
+ if attributes.value.class == String
65
+ resource_records = Aws::Route53::Types::ResourceRecord.new(value: attributes.value).orig_to_h
66
+ elsif attributes.value.class == Array
67
+ attributes.value.each do |v|
68
+ resource_records << Aws::Route53::Types::ResourceRecord.new(value: v).orig_to_h
69
+ end
70
+ end
71
+
72
+ @rrset_hash[:change_batch][:changes][0][:resource_record_set][:resource_records] = resource_records
65
73
  end
66
74
 
67
75
  def action_create(options)
68
- unless @record[0][0][0] == attributes.name
76
+ unless /#{attributes.name}/ === @record[0][0][0]
69
77
  resp = @route53.change_resource_record_sets(@rrset_hash)
70
78
  ItamaeMitsurin.logger.debug "#{resp}"
71
- ItamaeMitsurin.logger.info "created record #{attributes.name}"
79
+ ItamaeMitsurin.logger.color(:green) do
80
+ ItamaeMitsurin.logger.info "aws_route53_rrset[#{attributes.name}] created record"
81
+ end
72
82
  updated!
73
83
  end
74
84
  end
@@ -76,15 +86,19 @@ module ItamaeMitsurin
76
86
  def action_upsert(options)
77
87
  resp = @route53.change_resource_record_sets(@rrset_hash)
78
88
  ItamaeMitsurin.logger.debug "#{resp}"
79
- ItamaeMitsurin.logger.info "upserted record #{attributes.name}"
89
+ ItamaeMitsurin.logger.color(:green) do
90
+ ItamaeMitsurin.logger.info "aws_route53_rrset[#{attributes.name}] upserted record"
91
+ end
80
92
  updated!
81
93
  end
82
94
 
83
95
  def action_delete(options)
84
- if @record[0][0][0] == attributes.name
96
+ if /#{attributes.name}/ === @record[0][0][0]
85
97
  resp = @route53.change_resource_record_sets(@rrset_hash)
86
98
  ItamaeMitsurin.logger.debug "#{resp}"
87
- ItamaeMitsurin.logger.info "deleted record #{attributes.name}"
99
+ ItamaeMitsurin.logger.color(:green) do
100
+ ItamaeMitsurin.logger.info "aws_route53_rrset[#{attributes.name}] deleted record"
101
+ end
88
102
  updated!
89
103
  end
90
104
  end
@@ -1 +1 @@
1
- 0.34
1
+ 0.35
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-mitsurin
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.34'
4
+ version: '0.35'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akihiro Kamiyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-25 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor