Skip to content

Commit c2607d2

Browse files
jeremylenzclaude
andcommitted
Add --target-host parameter to production commands
Adds a --target-host argument to all 8 foremanctl production commands (deploy, features, health, migrate, backup, pull-images, certificate-bundle, checks) for feature parity with forge deploy-dev. The parameter is defined once in a shared _target_host metadata fragment and included by each command. Playbooks fall back to 'quadlet' when --target-host is not specified. The value is persisted between runs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 777e671 commit c2607d2

18 files changed

Lines changed: 33 additions & 12 deletions

docs/user/parameters.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ This document covers installation parameters as presented to users, and includes
77
* Using a single parameter when there are multiple variables that should have the same value
88
* Aim for minimal configuration values for the user
99

10+
## Global Parameters
11+
12+
| Parameter | Description | Applies to |
13+
| ----------| ----------- | ---------- |
14+
| `--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` |
15+
1016
## Mapping
1117

1218
Parameters are split into either mapped or unmapped groupings per category.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
variables:
3+
target_host:
4+
help: Target hostname or IP address for deployment
5+
action: store

src/playbooks/backup/backup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Backup databases and configuration
3-
hosts: quadlet
3+
hosts: "{{ target_host | default('quadlet') }}"
44
become: true
55
gather_facts: true
66
vars_files:

src/playbooks/backup/metadata.obsah.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ variables:
1818
help: Wait for running tasks to complete instead of failing immediately
1919
action: store_true
2020
persist: false
21+
22+
include:
23+
- _target_host

src/playbooks/certificate-bundle/certificate-bundle.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
- name: Generate a certificate bundle for a hostname
3-
hosts:
4-
- quadlet
3+
hosts: "{{ target_host | default('quadlet') }}"
54
become: true
65
vars_files:
76
- "../../vars/base.yaml"

src/playbooks/certificate-bundle/metadata.obsah.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ constraints:
3131
- ['certificates_source', 'default', ['certificates_custom_server_certificate', 'certificates_custom_server_key']]
3232

3333
include:
34+
- _target_host
3435
- _certificate_source

src/playbooks/checks/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Run preflight checks
3-
hosts: quadlet
3+
hosts: "{{ target_host | default('quadlet') }}"
44
gather_facts: true
55
vars_files:
66
- "../../vars/defaults.yml"

src/playbooks/checks/metadata.obsah.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ help: |
33
Run preflight checks before installing Foreman
44
55
include:
6+
- _target_host
67
- _database_mode
78
- _database_connection
89
- _tuning

src/playbooks/deploy/deploy.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
- name: Setup machine
3-
hosts:
4-
- quadlet
3+
hosts: "{{ target_host | default('quadlet') }}"
54
become: true
65
vars_files:
76
- "../../vars/defaults.yml"

src/playbooks/deploy/metadata.obsah.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ variables:
1616
help: Name of the PAM service to use for IPA authentication
1717

1818
include:
19+
- _target_host
1920
- _flavor_features
2021
- _flavors/katello

0 commit comments

Comments
 (0)