Validate that all roles have hosts

This commit is contained in:
Jeremy Daer
2023-03-22 18:56:57 -07:00
parent 1887a6518e
commit 035e4afff7
3 changed files with 57 additions and 9 deletions

View File

@@ -80,7 +80,7 @@ class Mrsk::Configuration
end
def primary_web_host
role(:web).hosts.first
role(:web).primary_host
end
def traefik_hosts
@@ -196,6 +196,12 @@ class Mrsk::Configuration
raise ArgumentError, "You must specify a password for the registry in config/deploy.yml (or set the ENV variable if that's used)"
end
roles.each do |role|
if role.hosts.empty?
raise ArgumentError, "No servers specified for the #{role.name} role"
end
end
true
end