Allow primary host even when a specific role has been set
This commit is contained in:
@@ -25,7 +25,7 @@ class Mrsk::Commander
|
|||||||
end
|
end
|
||||||
|
|
||||||
def primary_host
|
def primary_host
|
||||||
specific_hosts&.sole || config.primary_web_host
|
specific_hosts&.first || config.primary_web_host
|
||||||
end
|
end
|
||||||
|
|
||||||
def hosts
|
def hosts
|
||||||
|
|||||||
@@ -42,4 +42,9 @@ class CommanderTest < ActiveSupport::TestCase
|
|||||||
@mrsk.specific_primary!
|
@mrsk.specific_primary!
|
||||||
assert_equal [ "1.1.1.1" ], @mrsk.hosts
|
assert_equal [ "1.1.1.1" ], @mrsk.hosts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "primary_host with specific hosts via role" do
|
||||||
|
@mrsk.specific_roles = "web"
|
||||||
|
assert_equal "1.1.1.1", @mrsk.primary_host
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user