build-cloud 1.1.4 → 1.1.5

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
  SHA256:
3
- metadata.gz: b796de3789fd255b22a0bbb3c9b31b61b1a560fd9205b6766c6e0e8459a14d72
4
- data.tar.gz: 107602ff83bfd883c99972559de45eb7a4f67e1eaa293419faf8f520212333b1
3
+ metadata.gz: 6bcf14843354c6ea7a7c8a0deef9ccc1c35ffb560b6f9cda99043279f3a0a781
4
+ data.tar.gz: 5b01a023db2efe5018899afd3832746fc37679090f93f004fc21fb6cc11ee17d
5
5
  SHA512:
6
- metadata.gz: 8510ed1ab35448dd52567c7f5ea2a4136245e8d7e57467826d773a90ae7b933ffd016c716949d83492fb7f81d72f73f477888af2cf4c6fe969f43f21559fe3e2
7
- data.tar.gz: 6aafc72ea07eb7211ccf714c64148a6dad287fd3118e52e88b5c6eaa1420485235f4af6d5cac70bdd31cff0f9293f2271d46b3650e96971f745d7a1f11d21d5a
6
+ metadata.gz: dbfe670bd630c4df82d1d1a6cb72ec7ef65c013fc517e9a0c6594ce73a1b26b709d6059ca9368a09454e360377625c17b95d3fa1cc0a6e492fc060a672ca2ef4
7
+ data.tar.gz: df224f150e62d3460caa920c770ad10d8673c47bf3b1c10be4cd464259c3bf6a933b49103cd0fed7893aa4db35b16c4b50457d2b474df5b24e2856a156550fa7
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ 2018-06-18 - version 1.1.5 - Security groups now add missing tags.
4
+
3
5
  2018-06-18 - version 1.1.4 - Subnets now add missing tags.
4
6
 
5
7
  2018-04-12 - version 1.1.3 - EC2 instances and ASG now add missing tags.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "build-cloud"
7
- spec.version = "1.1.4"
7
+ spec.version = "1.1.5"
8
8
  spec.authors = ["The Scale Factory"]
9
9
  spec.email = ["info@scalefactory.com"]
10
10
  spec.summary = %q{Tools for building resources in AWS}
@@ -45,7 +45,12 @@ class BuildCloud::SecurityGroup
45
45
  options.delete(:authorized_ranges)
46
46
  end
47
47
 
48
- unless exists?
48
+ if exists?
49
+ # If exists update tags
50
+ if options[:tags]
51
+ create_tags(options[:tags])
52
+ end
53
+ else
49
54
 
50
55
  @log.info( "Creating security group #{@options[:name]}" )
51
56
 
@@ -210,5 +215,14 @@ class BuildCloud::SecurityGroup
210
215
 
211
216
  end
212
217
 
218
+ def create_tags(tags)
219
+ # force symbols to strings in yaml tags
220
+ resolved_tags = fog_object.tags.dup.merge(tags.collect{|k,v| [k.to_s, v]}.to_h)
221
+ if resolved_tags != fog_object.tags
222
+ @log.info("Updating tags for security group #{fog_object.name}")
223
+ @compute.create_tags( fog_object.group_id.to_s, tags )
224
+ end
225
+ end
226
+
213
227
  end
214
228
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Scale Factory
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-11 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler