vominator 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/ec2/instances.rb +17 -8
- data/lib/ec2/security_groups.rb +3 -1
- data/lib/ec2/ssm.rb +3 -1
- data/lib/vominator/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd74e5361fd321678260247c2db92d354b699e527b5f60598a34d54f819be3ca
|
4
|
+
data.tar.gz: 113e17a4250699011d8b09dfe87d1797371194c64f235b514af0d660bf2fa3ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6a17e0303d0e0f7130a9efeeb0030f0a4181daf419bf20369dd5f2ea3bd95fc807afbe5ca50f78fdc6a60931692a1b59de76b3f0d76ce9197e5ff602de23c6a
|
7
|
+
data.tar.gz: 6752c0df2646c65c6f2a6d75d56c70067f4d63ec761bae3ceb329cd8c921154a51007e766b2a3134a2ad7d1331219bc186b770e86b372bd89917623a0c7a07a2
|
data/README.md
CHANGED
@@ -21,8 +21,11 @@ See Usage for details about puke
|
|
21
21
|
configuration_path: Location to puke
|
22
22
|
key_pair_name: infrastructure@example.com
|
23
23
|
instances_file: Location for cache file IE /Users/foo/.vominator/instances-metadata
|
24
|
+
use_profiles: false
|
24
25
|
```
|
25
26
|
|
27
|
+
use_profiles: false will cause the AWS SDK to use the default credential provider chain.
|
28
|
+
|
26
29
|
## Usage
|
27
30
|
|
28
31
|
Everything with Vominator revolves around the concept of defining products. These products are a logical grouping of resources that describe how your product is deployed and accessed. These products are then associated with an environment so that you can quickly replicate resources between VPCs.
|
data/lib/ec2/instances.rb
CHANGED
@@ -110,7 +110,10 @@ unless instances
|
|
110
110
|
end
|
111
111
|
|
112
112
|
#Get ec2 connection, which is then passed to specific functions. Maybe a better way to do this?
|
113
|
-
|
113
|
+
if VOMINATOR_CONFIG['use_profiles']
|
114
|
+
Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
|
115
|
+
end
|
116
|
+
|
114
117
|
ec2 = Aws::EC2::Resource.new(region: puke_config['region_name'])
|
115
118
|
ec2_client = Aws::EC2::Client.new(region: puke_config['region_name'])
|
116
119
|
|
@@ -135,6 +138,19 @@ vpc_security_groups = Vominator::EC2.get_security_group_name_ids_hash(ec2, puke_
|
|
135
138
|
instances.each do |instance|
|
136
139
|
hostname = instance.keys[0]
|
137
140
|
fqdn = "#{hostname}.#{puke_config['domain']}"
|
141
|
+
|
142
|
+
LOGGER.info("Working on #{fqdn}")
|
143
|
+
|
144
|
+
if instance['not_environment'] && instance['not_environment'].include?(options[:environment])
|
145
|
+
LOGGER.info("#{fqdn} is not marked for deployment in #{options[:environment]}")
|
146
|
+
next
|
147
|
+
end
|
148
|
+
|
149
|
+
if instance['environment'] && !instance['environment'].include?(options[:environment])
|
150
|
+
LOGGER.info("#{fqdn} is not marked for deployment in #{options[:environment]}")
|
151
|
+
next
|
152
|
+
end
|
153
|
+
|
138
154
|
instance_type = instance['type'][options[:environment]] || instance['type']
|
139
155
|
instance_ip = (instance['ip'][options[:environment]] || instance['ip']).sub('OCTET',puke_config['octet'])
|
140
156
|
instance_security_groups = instance['security_groups'].map { |sg| sg}.uniq.sort
|
@@ -146,13 +162,6 @@ instances.each do |instance|
|
|
146
162
|
instance_az = instance['az'][options[:environment]] || instance['az']
|
147
163
|
instance_tags = instance['tags']
|
148
164
|
|
149
|
-
LOGGER.info("Working on #{fqdn}")
|
150
|
-
|
151
|
-
if instance['environment'] && !instance['environment'].include?(options[:environment])
|
152
|
-
LOGGER.info("#{fqdn} is not marked for deployment in #{options[:environment]}")
|
153
|
-
next
|
154
|
-
end
|
155
|
-
|
156
165
|
if instance_type.nil?
|
157
166
|
LOGGER.error("No instance size definition for #{fqdn}")
|
158
167
|
next
|
data/lib/ec2/security_groups.rb
CHANGED
@@ -103,8 +103,10 @@ end
|
|
103
103
|
unless puke_security_groups
|
104
104
|
LOGGER.fatal('Unable to load security groups . Make sure the product is correctly defined for the environment you have selected and that a security_groups.yaml file exists with at least one group defined.')
|
105
105
|
end
|
106
|
+
if VOMINATOR_CONFIG['use_profiles']
|
107
|
+
Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
|
108
|
+
end
|
106
109
|
|
107
|
-
Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
|
108
110
|
ec2_client = Aws::EC2::Client.new(region: puke_config['region_name'])
|
109
111
|
|
110
112
|
|
data/lib/ec2/ssm.rb
CHANGED
@@ -58,7 +58,9 @@ unless test?('Vominator is running in test mode. It will NOT make any changes.')
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
-
|
61
|
+
if VOMINATOR_CONFIG['use_profiles']
|
62
|
+
Aws.config[:credentials] = Aws::SharedCredentials.new(:profile_name => puke_config['account'])
|
63
|
+
end
|
62
64
|
ssm = Aws::SSM::Client.new(region: puke_config['region_name'])
|
63
65
|
|
64
66
|
aws_documents = Vominator::SSM.get_documents(ssm)
|
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.16
|
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:
|
13
|
+
date: 2020-02-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws-sdk
|
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
266
266
|
- !ruby/object:Gem::Version
|
267
267
|
version: '0'
|
268
268
|
requirements: []
|
269
|
-
rubygems_version: 3.0.
|
269
|
+
rubygems_version: 3.0.6
|
270
270
|
signing_key:
|
271
271
|
specification_version: 4
|
272
272
|
summary: Manage AWS resources from JSON templates and CLI.
|