ec2_bootstrap 1.3.0 → 1.3.1

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
- SHA1:
3
- metadata.gz: d41c969eb188dae779b8f4d25d45f6ccc20c4a47
4
- data.tar.gz: 2b3f9c3de3e91ed91a678d8c64a9401269b09435
2
+ SHA256:
3
+ metadata.gz: 12757e2781e60241b4c1c5f023021fe66b5ef4c9d373f5a3cff902ffeab9b988
4
+ data.tar.gz: b324dab79cbd0e9481b28d1ed085bba718221b62d9e6d0489027a9c2a3c6b6e5
5
5
  SHA512:
6
- metadata.gz: f51ee35ce49c07a516b3c5df1eefcb5a9b050a6cae71c08d79691f977fe209fee5e0c6ae1f933da97867f6f32e191ec9f15d2978453b276884a7f991fdfbfd61
7
- data.tar.gz: 894305d74efaaae51f23b41a471f6d18d203554983f58cc70087262814ec002ba318d8c7639bea008559b69a3d73196c9c69ebaa5e21fee9287ef07719377651
6
+ metadata.gz: 693699e133e547f2c39c021209ce8ac06579749cf20cc523e449d2471598e096f70c8c8a7de4ac37a6336e32cd726f34d6fdc7dca28064f91c33e824e9769055
7
+ data.tar.gz: 6db3dbb2194fd63de79855f1b2570704e568ae60f8a34eea949f61dbe4d6a53416264333e1ede0de7e847fc5cb570f4e259ed7f93af46f3733e244b375e5a9cb
@@ -7,6 +7,7 @@ class EC2Bootstrap
7
7
 
8
8
  attr_accessor :name
9
9
  attr_accessor :knife_ec2_flags
10
+ $AWS_TAGS = []
10
11
 
11
12
  def initialize(instance_name:, knife_ec2_flags:, logger:, dryrun:, domain: nil, json_attributes_file:nil, image: nil, cloud_config: nil)
12
13
  @name = instance_name
@@ -19,6 +20,8 @@ class EC2Bootstrap
19
20
  @image = image
20
21
  @domain = domain
21
22
 
23
+ $AWS_TAGS.append("Name=#{@name}")
24
+
22
25
  @knife_ec2_flags = build_knife_ec2_flags_hash(knife_ec2_flags, cloud_config)
23
26
  end
24
27
 
@@ -27,9 +30,13 @@ class EC2Bootstrap
27
30
  knife_ec2_flags['user-data'] = self.generate_cloud_init(cloud_config) if cloud_config and not knife_ec2_flags['user-data']
28
31
  knife_ec2_flags['image'] = @image unless knife_ec2_flags['image']
29
32
 
33
+
34
+ $AWS_TAGS = $AWS_TAGS + knife_ec2_flags['tags'] if knife_ec2_flags['tags']
35
+
36
+ knife_ec2_flags.delete('tags') if knife_ec2_flags['tags']
37
+
30
38
  additional_knife_flags = {
31
39
  'node-name' => @name,
32
- 'tags' => "Name=#{@name}",
33
40
  'no-host-key-verify' => ""
34
41
  }
35
42
 
@@ -56,8 +63,10 @@ class EC2Bootstrap
56
63
 
57
64
  def format_knife_shell_command
58
65
  prefix = 'knife ec2 server create '
66
+ aws_tags_string = $AWS_TAGS.map {|key | ['--aws-tag ' + key]}.flatten.compact
59
67
  knife_flag_array = @knife_ec2_flags.map {|key, value| ['--' + key, value]}.flatten.compact
60
- return prefix + knife_flag_array.join(' ')
68
+ @logger.info(prefix + knife_flag_array.join(' ') + aws_tags_string.join(' '))
69
+ return prefix + knife_flag_array.join(' ') + aws_tags_string.join(' ')
61
70
  end
62
71
 
63
72
  def generate_cloud_init(cloud_config)
@@ -1,3 +1,3 @@
1
1
  module Ec2Bootstrap
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
- - Cozy Services Ltd.
8
- - Rachel King
7
+ - Apartments Payments DevOps
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2017-12-20 00:00:00.000000000 Z
11
+ date: 2021-03-31 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
@@ -97,7 +96,7 @@ dependencies:
97
96
  version: '2'
98
97
  description: Bootstrap EC2 instances with custom config.
99
98
  email:
100
- - opensource@cozy.co
99
+ - devops-aptspayments@costar.com
101
100
  executables:
102
101
  - ec2_bootstrap
103
102
  extensions: []
@@ -133,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
132
  - !ruby/object:Gem::Version
134
133
  version: '0'
135
134
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.5.2
135
+ rubygems_version: 3.0.4
138
136
  signing_key:
139
137
  specification_version: 4
140
138
  summary: Bootstrap EC2 instances with custom config.