vominator 0.0.10 → 0.0.11
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.
- checksums.yaml +4 -4
- data/lib/ec2/instances.rb +12 -0
- data/lib/vominator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 838a4285c80d644368f923558bba78f0bd15ff1c
|
|
4
|
+
data.tar.gz: 8c89c085df0b45cb7a4fb54f42ec1f858b62c304
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cb81c2d796cce7c58b12bf752de5ac1925483f1e9a92f59c5a75d022a2bc4bc944eb9ff481c6d11663dfb14407ccea12b10443e9793c717cd2307e7d1fba9c3d
|
|
7
|
+
data.tar.gz: d4f8bedad5d9f09359c52b001e9c8403e421d771b107d74b2281898ac65341d7b5ec5f746657fa986536ef693a20bef3e756ae680c621b1530d2729448d27e8c
|
data/lib/ec2/instances.rb
CHANGED
|
@@ -144,6 +144,7 @@ instances.each do |instance|
|
|
|
144
144
|
key_name = Vominator.get_key_pair(VOMINATOR_CONFIG)
|
|
145
145
|
ssm_documents = instance['ssm_documents'].nil? ? [] : instance['ssm_documents']
|
|
146
146
|
instance_az = instance['az'][options[:environment]] || instance['az']
|
|
147
|
+
instance_tags = instance['tags']
|
|
147
148
|
|
|
148
149
|
LOGGER.info("Working on #{fqdn}")
|
|
149
150
|
|
|
@@ -178,6 +179,7 @@ instances.each do |instance|
|
|
|
178
179
|
ec2_instance = Vominator::EC2.get_instance(ec2, ec2_instances[instance_ip][:instance_id])
|
|
179
180
|
ec2_instance_security_groups = ec2_instances[instance_ip][:security_groups].uniq.sort
|
|
180
181
|
ec2_instance_ebs_volumes = Vominator::EC2.get_instance_ebs_volumes(ec2, ec2_instances[instance_ip][:instance_id])
|
|
182
|
+
ec2_instance_tags = Hash[ec2_instance.tags.map{ |x| [x.key, x.value]}]
|
|
181
183
|
|
|
182
184
|
if options[:disable_term_protection]
|
|
183
185
|
unless test?("Would disable instance termination protection for #{fqdn}")
|
|
@@ -341,6 +343,16 @@ instances.each do |instance|
|
|
|
341
343
|
end
|
|
342
344
|
end
|
|
343
345
|
end
|
|
346
|
+
|
|
347
|
+
instance_tags.each do |tag|
|
|
348
|
+
key = tag.split('=')[0]
|
|
349
|
+
value = tag.split('=')[1]
|
|
350
|
+
unless ec2_instance_tags.key?(key) || (ec2_instance_tags.key?(key) && ec2_instance_tags[key] != value)
|
|
351
|
+
unless test?("Would create or update tag #{key}:#{value}")
|
|
352
|
+
Vominator::EC2.tag_resource(ec2_client, ec2_instance.id, [{key: key, value: value}])
|
|
353
|
+
end
|
|
354
|
+
end
|
|
355
|
+
end
|
|
344
356
|
|
|
345
357
|
else #The instance does not exist, in which case we want to create it.
|
|
346
358
|
user_data = Vominator::Instances.generate_cloud_config(hostname, options[:environment], options[:environment].gsub('.','-'), instance['family'], instance['chef_roles'], instance['chef_recipes'])
|
data/lib/vominator/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vominator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Kelly
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2016-
|
|
13
|
+
date: 2016-08-17 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: aws-sdk
|