Skip to content

Commit

Permalink
Epicli validation and RabbitMQ and Postgress cluster fixes. (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
seriva authored and przemyslavic committed Oct 10, 2019
1 parent 23db98b commit cffda5a
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Epiphany cluster Config"
provider: any
name: "default"
specification:
name: YOUR_CLUSTER_NAME
name: name
admin_user:
name: operations # YOUR-ADMIN-USERNAME
key_path: /user/.ssh/epiphany-operations/id_rsa # YOUR-SSH-KEY-PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: "Epiphany cluster Config"
provider: aws
name: "default"
specification:
name: YOUR_CLUSTER_NAME
prefix: YOUR_CLUSTER_RESOURCES_PREFIX
name: name
prefix: prefix
admin_user:
name: operations # YOUR-ADMIN-USERNAME
key_path: /user/.ssh/epiphany-operations/id_rsa # YOUR-SSH-KEY-PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,26 @@ specification:
destination_port_range: "5672"
source_address_prefix: "10.1.0.0/20"
destination_address_prefix: "0.0.0.0/0"
- name: rabbitmq_clustering_1
description: Allow rabbitmq clustering traffic 1
priority: 304
direction: Inbound
access: Allow
protocol: Tcp
source_port_range: "*"
destination_port_range: "4369"
source_address_prefix: "10.1.8.0/24"
destination_address_prefix: "0.0.0.0/0"
- name: rabbitmq_clustering_1
description: Allow rabbitmq clustering traffic 2
priority: 305
direction: Inbound
access: Allow
protocol: Tcp
source_port_range: "*"
destination_port_range: "25672"
source_address_prefix: "10.1.8.0/24"
destination_address_prefix: "0.0.0.0/0"
- name: out
description: Allow out
priority: 101
Expand Down Expand Up @@ -649,6 +669,16 @@ specification:
destination_port_range: "0"
source_address_prefix: "10.1.2.0/24"
destination_address_prefix: "0.0.0.0/0"
- name: postgres_clustering
description: Allow Postgres clustering traffic
priority: 305
direction: Inbound
access: Allow
protocol: Tcp
source_port_range: "*"
destination_port_range: "5432"
source_address_prefix: "10.1.6.0/24"
destination_address_prefix: "0.0.0.0/0"
---
kind: infrastructure/virtual-machine
version: 0.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: "Epiphany cluster Config"
provider: azure
name: "default"
specification:
name: YOUR_CLUSTER_NAME
prefix: YOUR_CLUSTER_RESOURCES_PREFIX
name: name
prefix: prefix
admin_user:
name: operations # YOUR-ADMIN-USERNAME
key_path: /user/.ssh/epiphany-operations/id_rsa # YOUR-SSH-KEY-PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
let(:disable_sudo) { false }
if clustered == true
listInventoryHosts("rabbitmq").each do |val|
val = val.split(".")[0]
describe command("rabbitmqctl node_health_check -n rabbit@#{val}") do
its(:stdout) { should match /^Health check passed$/ }
its(:exit_status) { should eq 0 }
Expand All @@ -74,6 +75,7 @@
end
if clustered
listInventoryHosts("rabbitmq").each do |val|
val = val.split(".")[0]
describe command("rabbitmqctl cluster_status | awk '/running_nodes/,/}/'") do
its(:stdout) { should match /rabbit@#{val}/ }
its(:exit_status) { should eq 0 }
Expand Down Expand Up @@ -127,6 +129,7 @@
let(:disable_sudo) { false }
if clustered
listInventoryHosts("rabbitmq").each do |val|
val = val.split(".")[0]
describe command("curl -o /dev/null -s -w '%{http_code}' -u #{user}:#{pass} #{rabbitmq_host}:#{rabbitmq_api_port}/api/healthchecks/node/rabbit@#{val}") do
it "is expected to be equal" do
expect(subject.stdout.to_i).to eq 200
Expand Down Expand Up @@ -159,4 +162,4 @@
its(:stdout) { should match /Deleting user "#{user}"/ }
its(:exit_status) { should eq 0 }
end
end
end
2 changes: 1 addition & 1 deletion core/src/epicli/tests/serverspec-cli/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def hostInGroups?(role)
file.close
if input.include? "[#{role}]"
rows = input.split("[#{role}]")[1].split("[")[0]
return rows.include? ENV['TARGET_HOST']
return rows =~ /\b#{ENV['TARGET_HOST']}\b/
else return false
end
end
Expand Down
2 changes: 1 addition & 1 deletion docs/home/HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- [Epiphany cluster](./howto/CLUSTER.md)
- Epicli
- [How to create an Epiphany cluster on existing infrastructure](./howto/CLUSTER.md#how-to-create-an-epiphany-cluster-on-existing-infrastructure)
- [How to create an Epiphany cluster on a cloud provider](./howto/CLUSTER.md#how-to-create-an-epiphany-on-a-cloud-provider)
- [How to create an Epiphany cluster on a cloud provider](./howto/CLUSTER.md#how-to-create-an-epiphany-cluster-on-a-cloud-provider)
- [How to delete an Epiphany cluster on a cloud provider](./howto/CLUSTER.md#how-to-delete-an-epiphany-cluster-on-a-cloud-provider)
- [How to create an offline installation of for Epiphany cluster](./howto/CLUSTER.md#how-to-create-an-offline-installation-for-an-Epiphany-cluster)
- [Single machine cluster](./howto/CLUSTER.md#single-machine-cluster)
Expand Down

0 comments on commit cffda5a

Please sign in to comment.