Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Epicli validation and RabbitMQ and Postgress cluster fixes. #595

Merged
merged 3 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -138,6 +138,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 @@ -619,6 +639,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