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

Add allow_empty_roles to control aborting on roles with no hosts. #582

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

mdkent
Copy link
Member

@mdkent mdkent commented Nov 12, 2023

Add allow_empty_roles to control aborting on roles with no hosts.

This added flexibility allows you to define base roles that might not necessarily exist in each deploy destination.

eg:

config/deploy.yml

servers:
  web:
    cmd: bin/web
    <other important common config>

  jobs:
    cmd: bin/jobs
    <other important common config>

config/deploy.beta.yml

servers:
  web:
    cmd: bin/web
    hosts:
    - 1.1.1.1
    - 1.1.1.2

# No jobs on betas!

config/deploy.production.yml

servers:
  web:
    hosts:
    - 1.1.1.3
    - 1.1.1.4

  jobs:
    hosts:
    - 1.1.1.5
    - 1.1.1.6

config/deploy.staging.yml

servers:
  web:
    hosts:
    - 1.1.1.7
    - 1.1.1.8

  jobs:
    hosts:
    - 1.1.1.9
    - 1.1.1.10

without this a kamal deploy -d beta would fail with No servers specified for the jobs role.

This added flexibility allows you to define base roles that might not
necessarily exist in each deploy destination.
@mdkent mdkent requested a review from djmb November 12, 2023 17:06
Base automatically changed from set-primary-web-role to main November 13, 2023 09:27
@djmb djmb merged commit 8a85840 into main Nov 13, 2023
6 checks passed
@djmb djmb deleted the allow-empty-roles branch November 13, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants