fhcap-cli 0.4.7 → 0.4.8

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: 7442c785069713ce88491a3c794e162190f0d168
4
- data.tar.gz: c84d4ad6ef141c6204822b10bf7ff022b18491c3
3
+ metadata.gz: ddbd3378ec5fc7f63b7f35b5258b280094410dad
4
+ data.tar.gz: e2f741990616c6df616b0d3e15943d9c92016ede
5
5
  SHA512:
6
- metadata.gz: bd8af02970b9092f546fe75419c14e65b0c1ecc665a6071ad89108a968c4f78f0fdb61a2d2426bb30941e90bb4bc112e233d85c360f20a4c335a734c106f0850
7
- data.tar.gz: 3aacd843308e099f9c8e302f27eead3776410727e62b636acbe7fd00ae4b2ba19f932e68939346aa7fc0aee49788151b97a70f7e543cb51e2ce4eb79f61f5975
6
+ metadata.gz: c0c9e75019bf435b9f0bbf2b334a4886515e508d2746cd6623a65c28836bf6fba5a17df56af77ce97033fdbd6eda9d020e43e4c1364d46cc5fbf238ddd5e1037
7
+ data.tar.gz: 1a4fa88a8a2a39cb787f8cf3e6d5ea521515beda310cd88382b6a4199f5227a6c892411c1ec61d83b0bb270bf801c457c35e45254de7757c6cd76be09481bece
data/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
 
2
+ ## Unreleased
3
+
4
+ ## 0.4.8
5
+
6
+ * [RHMAP-7637] - Fix Chef::Config constant in global namespace
7
+ * [RHMAP-7532] - Fix OSE cluster generation in AWS accounts that do not have a default VPC
8
+ * Add OSE Console to cluster info task output
9
+ * Fix Route53 DNS creation when using a multiple AWS accounts
10
+
2
11
  ## 0.4.7
3
12
 
4
13
  * [RHMAP-6559] - Add ose-single template for AWS and OpenStack, creates a single node OpenShift Enterprise 3 instance.
@@ -21,6 +21,8 @@ if cluster_config[:vpc]
21
21
  cidr_block cluster_config[:vpc][:cidr]
22
22
  internet_gateway true
23
23
  main_routes '0.0.0.0/0' => :internet_gateway
24
+ enable_dns_support cluster_config[:vpc].key?(:enable_dns_support) ? cluster_config[:vpc][:enable_dns_support] : true
25
+ enable_dns_hostnames cluster_config[:vpc].key?(:enable_dns_hostnames) ? cluster_config[:vpc][:enable_dns_hostnames] : false
24
26
  end
25
27
  end
26
28
 
@@ -27,15 +27,15 @@ module Fhcap
27
27
  end
28
28
 
29
29
  def chef_server_config_for(name)
30
- Chef::Config.from_file(knife_config_file_for(name))
30
+ ::Chef::Config.from_file(knife_config_file_for(name))
31
31
  end
32
32
 
33
33
  def chef_server_config_hash_for(name)
34
34
  chef_server_config_for(name)
35
35
  chef_server_config = {
36
- chef_server_url: Chef::Config[:chef_server_url],
37
- node_name: Chef::Config[:node_name],
38
- client_key: Chef::Config[:client_key],
36
+ chef_server_url: ::Chef::Config[:chef_server_url],
37
+ node_name: ::Chef::Config[:node_name],
38
+ client_key: ::Chef::Config[:client_key],
39
39
  }
40
40
  end
41
41
 
@@ -153,4 +153,4 @@ module Fhcap
153
153
  end
154
154
 
155
155
  end
156
- end
156
+ end
@@ -150,7 +150,7 @@ module Fhcap
150
150
  ::Chef::Knife::Deps.load_deps
151
151
  knife_deps = ::Chef::Knife::Deps.new(["."])
152
152
  knife_deps.configure_chef
153
- Chef::Config[:cookbook_path] = repo_cookbook_paths
153
+ ::Chef::Config[:cookbook_path] = repo_cookbook_paths
154
154
 
155
155
  entries = ::Chef::ChefFS::FileSystem.list(knife_deps.local_fs, ::Chef::ChefFS::FilePattern.new("/cookbooks/#{name}/."))
156
156
  entries.each do |entry|
@@ -214,4 +214,4 @@ module Fhcap
214
214
  end
215
215
 
216
216
  end
217
- end
217
+ end
@@ -57,6 +57,14 @@ module Fhcap
57
57
  thor.say_status "[#{env}] RabbitMQ Dashboard:", "#{urls[env][:rabbitmq]}", :cyan
58
58
  end
59
59
 
60
+ search_cmd = "search 'chef_environment:#{env} AND roles:ose_master_server'"
61
+ search_options = '-a openshift.domain'
62
+ node = nodes_for(search_cmd, search_options).first
63
+ if node
64
+ urls[env][:ose_master] = "https://#{node['openshift.domain']}:8443"
65
+ thor.say_status "[#{env}] OpenShift Console:", "#{urls[env][:ose_master]}", :cyan
66
+ end
67
+
60
68
  end
61
69
 
62
70
  def nodes_for(search_cmd, search_options)
@@ -21,16 +21,11 @@ module Fhcap
21
21
  @environment_config = @cluster_config[:environments][@environment_name.to_sym] || {}
22
22
 
23
23
  template_filepath = File.join(Fhcap.source_root, 'templates', 'cluster', @cluster_config[:driver], "#{template}.json.erb")
24
- eruby = Erubis::Eruby.new(File.read(template_filepath))
25
- result = eruby.result(
26
- {
27
- config: {
28
- domain: @domain,
29
- environment_name: @environment_name
30
- }
31
- }
32
- )
33
- @environment_config.merge!(JSON.parse(result, {:symbolize_names => true}))
24
+ env_template_config = template_as_object(template_filepath, @cluster_config.merge({
25
+ domain: @domain,
26
+ environment_name: @environment_name
27
+ }))
28
+ @environment_config.merge!(env_template_config)
34
29
 
35
30
  @availability_zones = provider_availability_zones(@cluster_config[:provider_id], @cluster_config[:provider_config][:region])
36
31
  @cidr = @cluster_config[:provider_config][:cidr]
@@ -76,6 +71,11 @@ module Fhcap
76
71
  environment_config.delete(:security_groups)
77
72
  end
78
73
 
74
+ if environment_config[:vpc] && cluster_config[:vpc]
75
+ cluster_config[:vpc].merge!(environment_config[:vpc])
76
+ environment_config.delete(:vpc)
77
+ end
78
+
79
79
  cluster_config[:environments][environment_name.to_sym] = cluster_config[:environments][environment_name.to_sym] || {}
80
80
  cluster_config[:environments][environment_name.to_sym].merge!(environment_config)
81
81
  end
@@ -126,8 +126,6 @@ module Fhcap
126
126
  template_config = template_as_object(env_template_file, cluster_config)
127
127
 
128
128
  template_config[:environments].each do |env|
129
- env_template_file = File.join(Fhcap.source_root, 'templates', 'cluster', cluster_config[:driver], "#{env[:template]}.json.erb")
130
- template_config = template_as_object(env_template_file, cluster_config)
131
129
 
132
130
  env_domain = [env[:'domain-prefix'], cluster_config[:domain]].compact.join('.')
133
131
  env_cfg = {
@@ -38,8 +38,7 @@ module Fhcap
38
38
  creds = cfg[:credentials]
39
39
  client = Aws::Route53::Client.new(
40
40
  region: region,
41
- access_key_id: creds[:'aws-access-key'],
42
- secret_access_key: creds[:'aws-secret-key']
41
+ credentials: Aws::Credentials.new(creds[:'aws-access-key'], creds[:'aws-secret-key'])
43
42
  )
44
43
  yield client
45
44
  end
@@ -127,13 +127,13 @@ KcVGsryKN6cjE7yCDasnA7R2rVBV/7NWeJV77bmzT5O//rW4yIfUIg==
127
127
 
128
128
  def validate_knife_config(knife_config_file)
129
129
  if File.exists? knife_config_file
130
- Chef::Config.from_file(knife_config_file)
131
- unless File.exists? Chef::Config[:validation_key]
132
- thor.say_status 'missing', Chef::Config[:validation_key], :red
130
+ ::Chef::Config.from_file(knife_config_file)
131
+ unless File.exists? ::Chef::Config[:validation_key]
132
+ thor.say_status 'missing', ::Chef::Config[:validation_key], :red
133
133
  end
134
134
 
135
- unless File.exists? Chef::Config[:client_key]
136
- thor.say_status 'missing', Chef::Config[:client_key], :red
135
+ unless File.exists? ::Chef::Config[:client_key]
136
+ thor.say_status 'missing', ::Chef::Config[:client_key], :red
137
137
  end
138
138
  else
139
139
  thor.say_status 'missing', knife_config_file, :red
@@ -143,4 +143,4 @@ KcVGsryKN6cjE7yCDasnA7R2rVBV/7NWeJV77bmzT5O//rW4yIfUIg==
143
143
  end
144
144
  end
145
145
  end
146
- end
146
+ end
data/lib/fhcap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fhcap
2
- VERSION = "0.4.7"
2
+ VERSION = "0.4.8"
3
3
  end
@@ -6,7 +6,9 @@
6
6
  <%- unless config[:provider_config][:cidr] == "none" %>
7
7
  "vpc": {
8
8
  "region": "<%= config[:provider_config][:region] %>",
9
- "cidr": "<%= config[:provider_config][:cidr] %>"
9
+ "cidr": "<%= config[:provider_config][:cidr] %>",
10
+ "enable_dns_support": true,
11
+ "enable_dns_hostnames": false
10
12
  },
11
13
  <%- end %>
12
14
  "default_instance_options": {
@@ -1,5 +1,17 @@
1
1
  {
2
2
  "domain": "<%= config[:domain] %>",
3
+ <%- unless config[:provider_config][:cidr] == "none" -%>
4
+ "subnets": {
5
+ "1a": {
6
+ "cidr": "0/26",
7
+ "availability_zone": "1a"
8
+ }
9
+ },
10
+ "vpc": {
11
+ "enable_dns_support": true,
12
+ "enable_dns_hostnames": true
13
+ },
14
+ <%- end -%>
3
15
  "security_groups": {
4
16
  "oseinternal": {
5
17
  "authorize_ingress": [
@@ -68,6 +80,10 @@
68
80
  "oseinternal",
69
81
  "oseexternal"
70
82
  ]
83
+ <%- unless config[:provider_config][:cidr] == "none" -%>
84
+ ,"private_ip_address": "",
85
+ "subnet": "1a"
86
+ <%- end -%>
71
87
  },
72
88
  "run_list": [
73
89
  "role[ose_master_server]",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fhcap-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Nairn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor