fhcap-cli 0.4.5 → 0.4.6
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/.gitignore +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/fhcap-cli.gemspec +2 -1
- data/lib/cookbooks/provision/libraries/provision.rb +26 -11
- data/lib/cookbooks/provision/recipes/aws_cluster_create.rb +7 -0
- data/lib/cookbooks/provision/recipes/aws_cluster_create_elb.rb +6 -1
- data/lib/cookbooks/provision/recipes/aws_cluster_destroy.rb +17 -16
- data/lib/cookbooks/provision/recipes/cluster_bootstrap.rb +4 -0
- data/lib/cookbooks/provision/recipes/cluster_bootstrap_instances.rb +37 -0
- data/lib/cookbooks/provision/recipes/cluster_create_instances.rb +11 -9
- data/lib/cookbooks/provision/recipes/cluster_provision_instances.rb +12 -11
- data/lib/cookbooks/provision/recipes/galera_reset_cluster.rb +40 -36
- data/lib/cookbooks/provision/recipes/mongo_reset_cluster.rb +10 -9
- data/lib/cookbooks/provision/recipes/rabbitmq_reset_cluster.rb +3 -1
- data/lib/extensions/chef/solr/query/regexpable_query.rb +17 -0
- data/lib/fhcap/chef-dk/chef_runner.rb +4 -1
- data/lib/fhcap/cluster.rb +66 -14
- data/lib/fhcap/cookbook.rb +1 -0
- data/lib/fhcap/kitchen.rb +27 -4
- data/lib/fhcap/provider.rb +1 -1
- data/lib/fhcap/repos_helper.rb +1 -1
- data/lib/fhcap/tasks/chef/chef_task_base.rb +3 -1
- data/lib/fhcap/tasks/chef/chef_zero_server.rb +1 -0
- data/lib/fhcap/tasks/chef/cookbook/update_version.rb +1 -2
- data/lib/fhcap/tasks/chef/provisioning/chef_provisioning_task_base.rb +19 -4
- data/lib/fhcap/tasks/chef/provisioning/create.rb +6 -3
- data/lib/fhcap/tasks/cluster/cluster_task_base.rb +1 -0
- data/lib/fhcap/tasks/cluster/create.rb +4 -201
- data/lib/fhcap/tasks/cluster/create_dns_records.rb +108 -0
- data/lib/fhcap/tasks/cluster/create_environment.rb +1 -0
- data/lib/fhcap/tasks/cluster/generate.rb +135 -0
- data/lib/fhcap/tasks/provider/add.rb +11 -0
- data/lib/fhcap/version.rb +1 -1
- data/spec/fhcap/tasks/cluster/create_dns_records_spec.rb +64 -0
- data/spec/fhcap/tasks/cluster/create_spec.rb +34 -13
- data/spec/fhcap/tasks/cluster/generate_spec.rb +44 -0
- data/templates/chef/environment_core.json.erb +8 -3
- data/templates/chef/environment_farm.json.erb +5 -0
- data/templates/chef/environment_mbaas.json.erb +11 -2
- data/templates/chef/environment_single.json.erb +17 -8
- data/templates/cluster/aws/common.json.erb +1 -1
- data/templates/cluster/aws/core-3node.json.erb +14 -2
- data/templates/cluster/aws/core-small-9node.json.erb +13 -1
- data/templates/cluster/aws/mbaas-3node.json.erb +14 -2
- data/templates/cluster/aws/single-blank.json.erb +6 -0
- data/templates/cluster/aws/single.json.erb +13 -1
- data/templates/cluster/openstack/core-3node.json.erb +1 -1
- data/templates/kitchen/kitchen.docker.yml.erb +0 -3
- data/templates/kitchen/kitchen.generate.yml.erb +0 -1
- data/templates/kitchen/kitchen.vagrant.yml.erb +37 -0
- metadata +29 -5
@@ -0,0 +1,108 @@
|
|
1
|
+
require 'fhcap/tasks/cluster/cluster_task_base'
|
2
|
+
require "fhcap/tasks/dns/create_record"
|
3
|
+
|
4
|
+
module Fhcap
|
5
|
+
module Tasks
|
6
|
+
module Cluster
|
7
|
+
class CreateDNSRecords < ClusterTaskBase
|
8
|
+
|
9
|
+
def initialize(options)
|
10
|
+
super(options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
thor.say "Cluster::CreateDNSRecords", :yellow
|
15
|
+
create_dns_record
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def create_dns_record
|
21
|
+
send(:"create_dns_record_#{cluster_config[:driver]}")
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_dns_record_aws
|
25
|
+
cluster_config[:environments].each do |env_name, env_cfg|
|
26
|
+
env_cfg[:load_balancers].each do |lb_name, lb_cfg|
|
27
|
+
if lb_cfg[:scheme] == "internet-facing"
|
28
|
+
begin
|
29
|
+
require 'aws-sdk'
|
30
|
+
|
31
|
+
cfg = provider_config(cluster_config[:provider_id])
|
32
|
+
creds = cfg[:credentials]
|
33
|
+
|
34
|
+
elb = Aws::ElasticLoadBalancing::Client.new(
|
35
|
+
region: cluster_config[:provider_config][:region],
|
36
|
+
access_key_id: creds[:'aws-access-key'],
|
37
|
+
secret_access_key: creds[:'aws-secret-key']
|
38
|
+
)
|
39
|
+
|
40
|
+
lb = load_balancer_name_for(name, env_name, lb_name)
|
41
|
+
resp = elb.describe_load_balancers({
|
42
|
+
load_balancer_names: [lb],
|
43
|
+
page_size: 1,
|
44
|
+
})
|
45
|
+
|
46
|
+
elb = resp.load_balancer_descriptions.first
|
47
|
+
thor.say "Found ELB name: #{elb.load_balancer_name}, dns_name: #{elb.dns_name}, zone_id: #{elb.canonical_hosted_zone_name_id}"
|
48
|
+
|
49
|
+
dns_record_cfg = {
|
50
|
+
domain: "*.#{env_cfg[:domain]}",
|
51
|
+
:"alias-target" => {
|
52
|
+
dns_name: elb.dns_name,
|
53
|
+
hosted_zone_id: elb.canonical_hosted_zone_name_id
|
54
|
+
}
|
55
|
+
}
|
56
|
+
Dns::CreateRecord.new(@options.dup.merge(dns_record_cfg)).run
|
57
|
+
rescue Aws::ElasticLoadBalancing::Errors::LoadBalancerNotFound => e
|
58
|
+
thor.say_status 'error', "LoadBalancer #{lb} not found, unable to create DNS Entry", :red
|
59
|
+
rescue Aws::ElasticLoadBalancing::Errors::ServiceError => e
|
60
|
+
thor.say_status 'error', e.message, :red
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end if env_cfg[:load_balancers]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def create_dns_record_openstack
|
68
|
+
cluster_config[:environments].each do |env_name, env_cfg|
|
69
|
+
env_name = "#{name}-#{env_name}"
|
70
|
+
knife_config_file = knife_config_file_for(cluster_config[:chef_server])
|
71
|
+
#ToDo [RHMAP-2898] Use knife object
|
72
|
+
nodes = JSON.parse(`knife search "chef_environment:#{env_name} AND recipes:nginx_feedhenry\\:\\:loadbalancer" -c #{knife_config_file} -F json -a name -a cloud.public_ipv4`)
|
73
|
+
|
74
|
+
lb_node = nodes['rows'].collect do |row|
|
75
|
+
name, attrs = row.first
|
76
|
+
attrs
|
77
|
+
end.first
|
78
|
+
|
79
|
+
if lb_node
|
80
|
+
if lb_node['cloud.public_ipv4']
|
81
|
+
dns_record_cfg = {
|
82
|
+
domain: "*.#{env_cfg[:domain]}",
|
83
|
+
ipaddress: lb_node['cloud.public_ipv4']
|
84
|
+
}
|
85
|
+
Dns::CreateRecord.new(@options.dup.merge(dns_record_cfg)).run
|
86
|
+
else
|
87
|
+
thor.say "Found lb node '#{lb_node['name']}', but was unable to retrieve it's IP!!}"
|
88
|
+
end
|
89
|
+
else
|
90
|
+
thor.say "Unable to locate lb node in cluster!!"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def load_balancer_name_for(org_name, environment, lb_name)
|
96
|
+
fh_name_for('fh-lb', org_name, environment, lb_name)[0..31] #elb names have a max length of 32
|
97
|
+
end
|
98
|
+
|
99
|
+
def fh_name_for(*args)
|
100
|
+
args.collect do |str|
|
101
|
+
str.to_s.split('-')
|
102
|
+
end.flatten.uniq.join('-')
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
require 'fhcap/tasks/cluster/cluster_task_base'
|
2
|
+
require 'fhcap/tasks/cluster/create_environment'
|
3
|
+
require 'fhcap/tasks/chef/environments/create'
|
4
|
+
|
5
|
+
module Fhcap
|
6
|
+
module Tasks
|
7
|
+
module Cluster
|
8
|
+
class Generate < ClusterTaskBase
|
9
|
+
|
10
|
+
attr_reader :name, :cluster_config
|
11
|
+
|
12
|
+
def initialize(options)
|
13
|
+
super(options, false)
|
14
|
+
@template = options[:template]
|
15
|
+
@repo = options[:'repo']
|
16
|
+
@provider_config = options[:'provider-config'] || {}
|
17
|
+
@domain = options[:domain]
|
18
|
+
@ssl_cert = options[:'ssl-cert']
|
19
|
+
@dns_provider_id = options[:'dns-provider-id']
|
20
|
+
@chef_server = options[:'chef-server']
|
21
|
+
@provider_id = options[:'provider-id']
|
22
|
+
|
23
|
+
@cluster_config = {
|
24
|
+
id: @name,
|
25
|
+
template: @template,
|
26
|
+
driver: "",
|
27
|
+
domain: @domain,
|
28
|
+
repo: @repo,
|
29
|
+
chef_server: @chef_server,
|
30
|
+
provider_id: @provider_id
|
31
|
+
}.merge(@cluster_config)
|
32
|
+
|
33
|
+
@cluster_config[:provider_config] = @cluster_config[:provider_config] || {}
|
34
|
+
@cluster_config[:provider_config].merge!(@provider_config)
|
35
|
+
end
|
36
|
+
|
37
|
+
def run
|
38
|
+
thor.say "Cluster::Generate: name = #{@name}", :yellow
|
39
|
+
|
40
|
+
#Generate cluster config
|
41
|
+
generate_cluster_config
|
42
|
+
|
43
|
+
#Create environment files
|
44
|
+
generate_cluster_environments
|
45
|
+
|
46
|
+
#Write config to disk
|
47
|
+
cluster_file = find_cluster(name) || File.join(repo_dir(cluster_config[:repo]), repo_clusters_dir(cluster_config[:repo]), "#{name}.json")
|
48
|
+
thor.create_file(cluster_file, JSON.pretty_generate(cluster_config))
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
def required_config
|
54
|
+
{
|
55
|
+
repo: {
|
56
|
+
msg: "In which repo should this clusters config and environment files be stored?",
|
57
|
+
options: {:limited_to => repo_names}
|
58
|
+
},
|
59
|
+
domain: {
|
60
|
+
msg: "Base domain/hostname (e.g. foo.skunkhenry.com) for this cluster?",
|
61
|
+
},
|
62
|
+
chef_server: {
|
63
|
+
options: {:limited_to => chef_server_names}
|
64
|
+
},
|
65
|
+
provider_id: {
|
66
|
+
options: {:limited_to => provider_names_for('compute')}
|
67
|
+
},
|
68
|
+
template: {
|
69
|
+
options: {:limited_to => cluster_template_names}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
def aws_required_config
|
75
|
+
aws_regions = provider_config(@cluster_config[:provider_id])[:regions]
|
76
|
+
{
|
77
|
+
region: {
|
78
|
+
options: {:limited_to => aws_regions.keys.collect { |k| k.to_s }}
|
79
|
+
},
|
80
|
+
cidr: {
|
81
|
+
msg: "CIDR block for AWS VPC (e.g. 10.123.0.0/16)?",
|
82
|
+
}
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
def generate_cluster_config
|
87
|
+
ask_config(required_config, cluster_config)
|
88
|
+
cluster_config[:driver] = provider_type(cluster_config[:provider_id])
|
89
|
+
send(:"generate_cluster_config_#{cluster_config[:driver]}")
|
90
|
+
driver_template_file = File.join(Fhcap.source_root, 'templates', 'cluster', cluster_config[:driver], "common.json.erb")
|
91
|
+
driver_template_config = template_as_object(driver_template_file, cluster_config)
|
92
|
+
cluster_config.merge!(driver_template_config)
|
93
|
+
end
|
94
|
+
|
95
|
+
def generate_cluster_config_aws
|
96
|
+
ask_config(aws_required_config, cluster_config[:provider_config])
|
97
|
+
aws_regions = provider_config(cluster_config[:provider_id])[:regions]
|
98
|
+
cluster_config[:default_instance_options] = cluster_config[:default_instance_options] || {}
|
99
|
+
cluster_config[:default_instance_options][:image_id] = aws_regions[cluster_config[:provider_config][:region].to_sym][:base_image]
|
100
|
+
end
|
101
|
+
|
102
|
+
def generate_cluster_config_openstack
|
103
|
+
cluster_config[:default_instance_options] = cluster_config[:default_instance_options] || {}
|
104
|
+
cluster_config[:default_instance_options][:image_ref] = provider_config(@cluster_config[:provider_id])[:image_ref]
|
105
|
+
cluster_config[:default_instance_options][:flavor_ref] = provider_config(@cluster_config[:provider_id])[:flavor_ref]
|
106
|
+
cluster_config[:default_instance_options][:floating_ip_pool] = provider_config(@cluster_config[:provider_id])[:floating_ip_pool]
|
107
|
+
cluster_config[:default_instance_options][:ssh_username] = provider_config(@cluster_config[:provider_id])[:ssh_username]
|
108
|
+
end
|
109
|
+
|
110
|
+
def generate_cluster_environments
|
111
|
+
env_template_file = File.join(Fhcap.source_root, 'templates', 'cluster', "#{cluster_config[:template]}.json.erb")
|
112
|
+
template_config = template_as_object(env_template_file, cluster_config)
|
113
|
+
|
114
|
+
template_config[:environments].each do |env|
|
115
|
+
env_template_file = File.join(Fhcap.source_root, 'templates', 'cluster', cluster_config[:driver], "#{env[:template]}.json.erb")
|
116
|
+
template_config = template_as_object(env_template_file, cluster_config)
|
117
|
+
|
118
|
+
env_domain = [env[:'domain-prefix'], cluster_config[:domain]].compact.join('.')
|
119
|
+
env_cfg = {
|
120
|
+
:name => name,
|
121
|
+
:'environment-name' => env[:name],
|
122
|
+
:domain => env_domain,
|
123
|
+
:template => env[:template],
|
124
|
+
:'cluster-config' => cluster_config,
|
125
|
+
:'skip-create-cluster-file' => true
|
126
|
+
}
|
127
|
+
|
128
|
+
CreateEnvironment.new(@options.dup.merge(env_cfg)).run
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
@@ -10,6 +10,7 @@ module Fhcap
|
|
10
10
|
|
11
11
|
AWS_REQUIRED_CREDENTIALS = %w{aws-access-key aws-secret-key}
|
12
12
|
OS_REQUIRED_CREDENTIALS = %w{os-auth-url os-tenant-id os-tenant-name os-username os-password}
|
13
|
+
DNSMADEEASY_REQUIRED_CREDENTIALS = %w{api-key secret-key}
|
13
14
|
|
14
15
|
def initialize(options)
|
15
16
|
super
|
@@ -20,6 +21,8 @@ module Fhcap
|
|
20
21
|
@required_credentials = AWS_REQUIRED_CREDENTIALS
|
21
22
|
elsif options[:type] == 'openstack'
|
22
23
|
@required_credentials = OS_REQUIRED_CREDENTIALS
|
24
|
+
elsif options[:type] == 'dnsmadeeasy'
|
25
|
+
@required_credentials = DNSMADEEASY_REQUIRED_CREDENTIALS
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
@@ -129,6 +132,14 @@ module Fhcap
|
|
129
132
|
cfg[:provides] << 'dns'
|
130
133
|
cfg[:provides].uniq!
|
131
134
|
end
|
135
|
+
|
136
|
+
def dnsmadeeasy_config(cfg)
|
137
|
+
creds = cfg[:credentials]
|
138
|
+
domains = thor.ask("Domains: ").split(' ')
|
139
|
+
cfg[:domains] = domains
|
140
|
+
cfg[:provides] << 'dns'
|
141
|
+
cfg[:provides].uniq!
|
142
|
+
end
|
132
143
|
|
133
144
|
end
|
134
145
|
end
|
data/lib/fhcap/version.rb
CHANGED
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require "fhcap/tasks/cluster/create_dns_records"
|
3
|
+
|
4
|
+
describe Fhcap::Tasks::Cluster::CreateDNSRecords do
|
5
|
+
|
6
|
+
subject {
|
7
|
+
Fhcap::Tasks::Cluster::CreateDNSRecords.new(options)
|
8
|
+
}
|
9
|
+
|
10
|
+
let(:thor) do
|
11
|
+
DummyThor.new
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:config) do
|
15
|
+
DummyConfig.new
|
16
|
+
end
|
17
|
+
|
18
|
+
let(:options) do
|
19
|
+
{
|
20
|
+
:config => config,
|
21
|
+
:thor => thor,
|
22
|
+
:name => 'testcluster',
|
23
|
+
:'cluster-config' => {
|
24
|
+
:id => 'testcluster',
|
25
|
+
:repo => 'testrepo',
|
26
|
+
:template => 'template',
|
27
|
+
:domain => 'testdomain',
|
28
|
+
:chef_server => 'test',
|
29
|
+
:provider_id => 'test'
|
30
|
+
}
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "#initialize" do
|
35
|
+
specify { expect(subject.name).to eq(options[:name]) }
|
36
|
+
end
|
37
|
+
|
38
|
+
context "missing cluster config" do
|
39
|
+
let(:options) do
|
40
|
+
{
|
41
|
+
:config => config,
|
42
|
+
:thor => thor,
|
43
|
+
:name => 'testcluster'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "#initialize" do
|
48
|
+
it "should raise error and exit" do
|
49
|
+
expect { subject }.to raise_error(SystemExit)
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should output correct error message" do
|
53
|
+
expect {
|
54
|
+
begin
|
55
|
+
subject
|
56
|
+
rescue SystemExit
|
57
|
+
end
|
58
|
+
}.to output(/Unknown cluster #{options[:name]}/).to_stdout
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -20,27 +20,48 @@ describe Fhcap::Tasks::Cluster::Create do
|
|
20
20
|
:config => config,
|
21
21
|
:thor => thor,
|
22
22
|
:name => 'testcluster',
|
23
|
-
:repo => 'testrepo',
|
24
|
-
:template => 'template',
|
25
23
|
:'git-ref' => 'master',
|
26
|
-
:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
:'cluster-config' => {
|
25
|
+
:id => 'testcluster',
|
26
|
+
:repo => 'testrepo',
|
27
|
+
:template => 'template',
|
28
|
+
:domain => 'testdomain',
|
29
|
+
:chef_server => 'test',
|
30
|
+
:provider_id => 'test'
|
31
|
+
}
|
31
32
|
}
|
32
33
|
end
|
33
34
|
|
34
35
|
describe "#initialize" do
|
35
36
|
specify { expect(subject.name).to eq(options[:name]) }
|
36
37
|
specify { expect(subject.instance_variable_get(:@gitref)).to eq(options[:'git-ref']) }
|
37
|
-
specify { expect(subject.instance_variable_get(:@ssl_cert)).to eq(options[:'ssl-cert']) }
|
38
|
-
specify { expect(subject.instance_variable_get(:@dns_provider_id)).to eq(options[:'dns-provider-id']) }
|
39
38
|
specify { expect(subject.cluster_config[:id]).to eq(options[:name]) }
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
end
|
40
|
+
|
41
|
+
context "missing cluster config" do
|
42
|
+
let(:options) do
|
43
|
+
{
|
44
|
+
:config => config,
|
45
|
+
:thor => thor,
|
46
|
+
:name => 'testcluster',
|
47
|
+
:'git-ref' => 'master'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "#initialize" do
|
52
|
+
it "should raise error and exit" do
|
53
|
+
expect { subject }.to raise_error(SystemExit)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should output correct error message" do
|
57
|
+
expect {
|
58
|
+
begin subject
|
59
|
+
rescue SystemExit
|
60
|
+
end
|
61
|
+
}.to output(/Unknown cluster #{options[:name]}/).to_stdout
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
44
65
|
end
|
45
66
|
|
46
67
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require "fhcap/tasks/cluster/generate"
|
3
|
+
|
4
|
+
describe Fhcap::Tasks::Cluster::Generate do
|
5
|
+
|
6
|
+
subject {
|
7
|
+
Fhcap::Tasks::Cluster::Generate.new(options)
|
8
|
+
}
|
9
|
+
|
10
|
+
let(:thor) do
|
11
|
+
DummyThor.new
|
12
|
+
end
|
13
|
+
|
14
|
+
let(:config) do
|
15
|
+
DummyConfig.new
|
16
|
+
end
|
17
|
+
|
18
|
+
let(:options) do
|
19
|
+
{
|
20
|
+
:config => config,
|
21
|
+
:thor => thor,
|
22
|
+
:name => 'testcluster',
|
23
|
+
:repo => 'testrepo',
|
24
|
+
:template => 'template',
|
25
|
+
:domain => 'testdomain',
|
26
|
+
:'ssl-cert' => 'testcert',
|
27
|
+
:'dns-provider-id' => 'test',
|
28
|
+
:'chef-server' => 'test',
|
29
|
+
:'provider-id' => 'test',
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "#initialize" do
|
34
|
+
specify { expect(subject.name).to eq(options[:name]) }
|
35
|
+
specify { expect(subject.instance_variable_get(:@ssl_cert)).to eq(options[:'ssl-cert']) }
|
36
|
+
specify { expect(subject.instance_variable_get(:@dns_provider_id)).to eq(options[:'dns-provider-id']) }
|
37
|
+
specify { expect(subject.cluster_config[:id]).to eq(options[:name]) }
|
38
|
+
specify { expect(subject.cluster_config[:template]).to eq(options[:template]) }
|
39
|
+
specify { expect(subject.cluster_config[:domain]).to eq(options[:domain]) }
|
40
|
+
specify { expect(subject.cluster_config[:chef_server]).to eq(options[:'chef-server']) }
|
41
|
+
specify { expect(subject.cluster_config[:provider_id]).to eq(options[:'provider-id']) }
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -36,7 +36,7 @@ end
|
|
36
36
|
"url": "e103-stg-digman-01.feedhenry.net"
|
37
37
|
},
|
38
38
|
"ios": {
|
39
|
-
"url": "
|
39
|
+
"url": "meh1-builder.feedhenry.net"
|
40
40
|
}
|
41
41
|
}
|
42
42
|
},
|
@@ -60,6 +60,7 @@ end
|
|
60
60
|
}
|
61
61
|
},
|
62
62
|
"feedhenry_galera": {
|
63
|
+
"cluster_enabled": true,
|
63
64
|
"safe-updates": false,
|
64
65
|
"wsrep": {
|
65
66
|
"password": "<%= random_password('galerawsrep') %>"
|
@@ -222,8 +223,7 @@ end
|
|
222
223
|
"auto_configure": {
|
223
224
|
"replicaset": true
|
224
225
|
},
|
225
|
-
"configfile": null
|
226
|
-
"nojournal": true
|
226
|
+
"configfile": null
|
227
227
|
},
|
228
228
|
"mongodb_feedhenry": {
|
229
229
|
"replicaset_enabled": true,
|
@@ -261,6 +261,11 @@ end
|
|
261
261
|
"contacts_databag": "nagios_contacts",
|
262
262
|
"notifications_enabled": 0
|
263
263
|
},
|
264
|
+
"nagios_feedhenry": {
|
265
|
+
"api": {
|
266
|
+
"enabled": false
|
267
|
+
}
|
268
|
+
},
|
264
269
|
"nginx_feedhenry": {
|
265
270
|
"ssl_cert_item": "wildcard.<%= config[:domain] %>",
|
266
271
|
"loadbalancer": "<%= config[:domain].gsub('.', '\\.') %>"
|
@@ -41,6 +41,11 @@ end
|
|
41
41
|
"services_databag": "nagios_services,nagios_services_<%= config[:name].gsub('-', '_') %>",
|
42
42
|
"contacts_databag": "nagios_contacts",
|
43
43
|
"notifications_enabled": 0
|
44
|
+
},
|
45
|
+
"nagios_feedhenry": {
|
46
|
+
"api": {
|
47
|
+
"enabled": false
|
48
|
+
}
|
44
49
|
}
|
45
50
|
},
|
46
51
|
"override_attributes": {
|
@@ -26,6 +26,11 @@ end
|
|
26
26
|
"json_class": "Chef::Environment",
|
27
27
|
"chef_type": "environment",
|
28
28
|
"default_attributes": {
|
29
|
+
"apache2_feedhenry": {
|
30
|
+
"ops_proxy": {
|
31
|
+
"enabled": false
|
32
|
+
}
|
33
|
+
},
|
29
34
|
"feedhenry_common": {
|
30
35
|
"backups": {
|
31
36
|
"enabled": false
|
@@ -106,8 +111,7 @@ end
|
|
106
111
|
"auto_configure": {
|
107
112
|
"replicaset": true
|
108
113
|
},
|
109
|
-
"configfile": null
|
110
|
-
"nojournal": true
|
114
|
+
"configfile": null
|
111
115
|
},
|
112
116
|
"mongodb_feedhenry": {
|
113
117
|
"replicaset_enabled": true,
|
@@ -125,6 +129,11 @@ end
|
|
125
129
|
"contacts_databag": "nagios_contacts",
|
126
130
|
"notifications_enabled": 0
|
127
131
|
},
|
132
|
+
"nagios_feedhenry": {
|
133
|
+
"api": {
|
134
|
+
"enabled": false
|
135
|
+
}
|
136
|
+
},
|
128
137
|
"nginx_feedhenry": {
|
129
138
|
"ssl_cert_item": "wildcard.<%= config[:domain] %>",
|
130
139
|
"loadbalancer": "<%= config[:domain].gsub('.', '\\.') %>"
|
@@ -27,7 +27,7 @@ end
|
|
27
27
|
"url": "e103-stg-digman-01.feedhenry.net"
|
28
28
|
},
|
29
29
|
"ios": {
|
30
|
-
"url": "
|
30
|
+
"url": "meh1-builder.feedhenry.net"
|
31
31
|
}
|
32
32
|
}
|
33
33
|
},
|
@@ -142,27 +142,31 @@ end
|
|
142
142
|
"url": "http://api.<%= config[:domain] %>",
|
143
143
|
"servicekey": "mBqxpulwlj3Rw7EsHZq0YEQyrArq2tlIRCQ0pCmr5DRPPDZMAP4ZNb7U0E6bPSb3",
|
144
144
|
"username": "df-<%= config[:name] %>",
|
145
|
-
"password": "feedhenry101"
|
145
|
+
"password": "feedhenry101",
|
146
|
+
"domain":"testing"
|
146
147
|
}
|
147
148
|
},
|
148
149
|
"environments": {
|
149
150
|
"dev": {
|
150
151
|
"label": "Development",
|
151
|
-
"
|
152
|
+
"target": "mbaas1",
|
152
153
|
"autoDeployOnCreate": true,
|
153
|
-
"autoDeployOnUpdate": false
|
154
|
+
"autoDeployOnUpdate": false,
|
155
|
+
"domain":"testing"
|
154
156
|
},
|
155
157
|
"test": {
|
156
158
|
"label": "Test",
|
157
|
-
"
|
159
|
+
"target": "mbaas1",
|
158
160
|
"autoDeployOnCreate": false,
|
159
|
-
"autoDeployOnUpdate": false
|
161
|
+
"autoDeployOnUpdate": false,
|
162
|
+
"domain":"testing"
|
160
163
|
},
|
161
164
|
"live": {
|
162
165
|
"label": "Production",
|
163
|
-
"
|
166
|
+
"target": "mbaas1",
|
164
167
|
"autoDeployOnCreate": false,
|
165
|
-
"autoDeployOnUpdate": false
|
168
|
+
"autoDeployOnUpdate": false,
|
169
|
+
"domain":"testing"
|
166
170
|
}
|
167
171
|
}
|
168
172
|
}
|
@@ -282,6 +286,11 @@ end
|
|
282
286
|
"contacts_databag": "nagios_contacts",
|
283
287
|
"notifications_enabled": 0
|
284
288
|
},
|
289
|
+
"nagios_feedhenry": {
|
290
|
+
"api": {
|
291
|
+
"enabled": false
|
292
|
+
}
|
293
|
+
},
|
285
294
|
"nginx_feedhenry": {
|
286
295
|
"loadbalancer": "<%= config[:domain].gsub('.', '\\.') %>"
|
287
296
|
}
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"protocols": ["all"],
|
36
36
|
"start": 0,
|
37
37
|
"end": 65535,
|
38
|
-
"sources": ["83.147.149.210/32", "46.38.161.225/32", "54.229.76.48/32", "79.125.117.182/32", "78.137.150.209/32"]
|
38
|
+
"sources": ["83.147.149.210/32", "46.38.161.225/32", "54.229.76.48/32", "79.125.117.182/32", "78.137.150.209/32", "52.37.106.23", "52.50.12.70", "52.62.158.176", "52.70.198.93", "52.193.17.19", "52.86.106.110", "52.48.49.57"]
|
39
39
|
}
|
40
40
|
]
|
41
41
|
},
|
@@ -37,7 +37,19 @@
|
|
37
37
|
"protocols": ["all"],
|
38
38
|
"start": 0,
|
39
39
|
"end": 65535,
|
40
|
-
"groups": ["<%= config[:environment_name] %>"
|
40
|
+
"groups": ["<%= config[:environment_name] %>"]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"protocols": ["icmp"],
|
44
|
+
"start": -1,
|
45
|
+
"end": -1,
|
46
|
+
"groups": ["<%= config[:environment_name] %>"]
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"protocols": ["tcp"],
|
50
|
+
"start": 80,
|
51
|
+
"end": 80,
|
52
|
+
"groups": ["<%= config[:environment_name] %>-studio-lb"]
|
41
53
|
}
|
42
54
|
]
|
43
55
|
},
|
@@ -100,7 +112,7 @@
|
|
100
112
|
"private_ip_address": "",
|
101
113
|
"subnet": "1c"
|
102
114
|
},
|
103
|
-
"run_list": ["role[platform_mongo_server]", "role[
|
115
|
+
"run_list": ["role[mount_data_volumes]", "role[platform_mongo_server]", "role[galera_arbiter_server]", "role[gitlab-shell_server]", "role[management_server]", "recipe[feedhenry_common::fhctl]"]
|
104
116
|
}
|
105
117
|
}
|
106
118
|
}
|
@@ -37,7 +37,19 @@
|
|
37
37
|
"protocols": ["all"],
|
38
38
|
"start": 0,
|
39
39
|
"end": 65535,
|
40
|
-
"groups": ["
|
40
|
+
"groups": ["<%= config[:environment_name] %>"]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"protocols": ["icmp"],
|
44
|
+
"start": -1,
|
45
|
+
"end": -1,
|
46
|
+
"groups": ["<%= config[:environment_name] %>"]
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"protocols": ["tcp"],
|
50
|
+
"start": 80,
|
51
|
+
"end": 80,
|
52
|
+
"groups": ["<%= config[:environment_name] %>-studio-lb"]
|
41
53
|
}
|
42
54
|
]
|
43
55
|
},
|