Merge pull request #212 from basecamp/role-primary-hosts
Pull the primary host from the role
This commit is contained in:
@@ -36,7 +36,7 @@ class Mrsk::Commander
|
|||||||
end
|
end
|
||||||
|
|
||||||
def primary_host
|
def primary_host
|
||||||
specific_hosts&.first || config.primary_web_host
|
specific_hosts&.first || specific_roles&.first&.primary_host || config.primary_web_host
|
||||||
end
|
end
|
||||||
|
|
||||||
def roles
|
def roles
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ class CommanderTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "primary_host with specific hosts via role" do
|
test "primary_host with specific hosts via role" do
|
||||||
@mrsk.specific_roles = "web"
|
@mrsk.specific_roles = "workers"
|
||||||
assert_equal "1.1.1.1", @mrsk.primary_host
|
assert_equal "1.1.1.3", @mrsk.primary_host
|
||||||
end
|
end
|
||||||
|
|
||||||
test "roles_on" do
|
test "roles_on" do
|
||||||
|
|||||||
Reference in New Issue
Block a user