Add --target-host parameter for multi-host management#633
Conversation
|
I think you might also need to ensure the host is in the Ansible inventory. If so, perhaps it's worth a small docs line. |
c802e7d to
c2607d2
Compare
For me this change is not about parity, it's about the need to run these commands against multiple hosts in some cases such as deploying multiple external proxies or executing a backup of a server vs. a proxy. That's my way of saying can you update the commit message and description to speak more to this idea? Additionally, while this will unlock the ability to run commands against more targets, this will be limited by #630 @evgeni what do you think? I'm generally in favor of this |
c2607d2 to
1168bdb
Compare
|
@ehelms Updated the description and commit message. 👍 |
|
What is the intended end state for where we recommend users run foremanctl, if there is one? Do we want users to be able to do every foremanctl action against any reachable host? For example, if setting up smart proxies, will it be totally legit for users to deploy the Foreman and the proxy from some exterior controller machine? I just want to understand if this |
|
I will defer to @ehelms to answer this |
Whatever the answer ends up being, I like this 👍 |
|
|
||
| | Parameter | Description | Applies to | | ||
| | ----------| ----------- | ---------- | | ||
| | `--target-host` | Target hostname or IP address for deployment. Defaults to `quadlet`. This value is persisted between runs. For remote hosts, the specified host must be present in the Ansible inventory. | All commands except `deploy-proxy` | |
There was a problem hiding this comment.
Why except deploy-proxy? (This is not a "I think you're wrong", more a "I want to understand your trail of thought")
|
I like this, but I also think it's dangerous in the current state, so not sure I'd like to expose it to users just yet. Right now this allows setting up multiple Foreman instances, with the same set of features/configs. I don't think that's terribly useful in most cases? Unless you have a prod and a test box that should be identical and you can manage them from the same controller. The PR description says that can be used to deploy multiple proxies, but it's not used in Overall I think I'd like to understand more which user workflows this enables now, without #630 being solved. |
The one workflow that started it for me is that I was unable to run |
Good catch —
Agreed that without #630, this is limited to single-target workflows where you're only ever pointing at one host at a time — just not one called |
First step toward multi-host management, allowing users to specify which host to run against instead of the hardcoded 'quadlet' default. Full multi-host workflows will additionally require per-host state isolation (foremanctl#630). Adds --target-host to all 8 production commands via a shared _target_host metadata fragment. Playbooks fall back to 'quadlet' when not specified. The value is persisted between runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1168bdb to
07c3a9e
Compare
Summary
Adds a
--target-hostargument to all 8 productionforemanctlcommands (deploy, features, health, migrate, backup, pull-images, certificate-bundle, checks), allowing users to specify which host to run against instead of the hardcodedquadletdefault.This is a first step toward multi-host management — running commands against different targets such as external proxies or remote servers. Full multi-host workflows will additionally require per-host state isolation (#630), since today all commands share a single
parameters.yaml.The parameter defaults to
quadletwhen not specified, preserving existing behavior. The value is persisted between runs and can be cleared with--reset-target-host.For remote hosts, the specified host must be present in the Ansible inventory.
Changes
_target_hostincluded by all 8 commandshosts:directives use{{ target_host | default('quadlet') }}docs/user/parameters.mdwith a Global Parameters sectionTest plan
foremanctl <command> --helpshows--target-hostfor all 8 commands