diff --git a/lib/kamal/configuration/accessory.rb b/lib/kamal/configuration/accessory.rb index 3258c9d0..aeb5f334 100644 --- a/lib/kamal/configuration/accessory.rb +++ b/lib/kamal/configuration/accessory.rb @@ -176,7 +176,9 @@ def hosts_from_hosts def hosts_from_roles if accessory_config.key?("roles") - accessory_config["roles"].flat_map { |role| config.role(role).hosts } + accessory_config["roles"].flat_map do |role| + config.role(role)&.hosts || raise(Kamal::ConfigurationError, "Unknown role in accessories config: '#{role}'") + end end end