Skip to content

Add copy-bundle forge command for proxy deployments - #619

Open
ehelms wants to merge 1 commit into
theforeman:masterfrom
ehelms:copy-bundle-command
Open

Add copy-bundle forge command for proxy deployments#619
ehelms wants to merge 1 commit into
theforeman:masterfrom
ehelms:copy-bundle-command

Conversation

@ehelms

@ehelms ehelms commented Jul 3, 2026

Copy link
Copy Markdown
Member

Why are you introducing these changes? (Problem description, related links)

Deploying a proxy requires manually fetching the certificate bundle, copying it to the proxy VM, and then constructing the deploy-proxy command with the correct bundle path, FQDN, and oauth credentials. This is error-prone and requires looking up values from multiple sources.

What are the changes introduced in this pull request?

  • Extend forge fetch-bundle to copy the certificate bundle to the proxy VM at /root/<hostname>.tar.gz when a proxy is in the inventory
  • Print the full deploy-proxy command with the correct --certificate-bundle, --foreman-fqdn, --oauth-consumer-key, and --oauth-consumer-secret arguments
  • When no proxy is in the inventory, the command behaves as before (fetch only)
  • Update the certificates extract.yml to use remote_src: true on the unarchive task and remove delegate_to: localhost on the stat check, since the bundle now resides on the target host rather than the Ansible controller

How to test this pull request

Steps to reproduce:

  • Deploy Foreman on quadlet: ./foremanctl deploy --initial-admin-password=changeme --tuning development --add-feature foreman-proxy
  • Generate a certificate bundle: ./foremanctl certificate-bundle proxy.example.com
  • Fetch and copy the bundle: ./forge fetch-bundle proxy.example.com
  • Verify the output shows the deploy-proxy command with all required arguments
  • Run the printed deploy-proxy command and verify the proxy deploys successfully
  • Verify ./forge fetch-bundle still works without a proxy VM in the inventory

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

- "../../../src/vars/certificates.yml"
- "../../../src/vars/foreman.yml"
tasks:
- name: Fetch bundle

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arvind4501

Copy link
Copy Markdown
Contributor

I tried similar thing in CI earlier 959a001#diff-faff1af3d8ff408964a57b2e475f69a6b7c7b71c9978cccc8f471798caac2c88R418-R419 , also i like what @evgeni mentioned about the approch of keeping things on system and then use it to deploy to any no of nodes

@ehelms
ehelms force-pushed the copy-bundle-command branch from fbbc770 to a1b33af Compare July 4, 2026 12:32
Extends the fetch-bundle forge command to also copy the certificate
bundle to the proxy VM when one is in the inventory, and print the
full deploy-proxy command with bundle path, FQDN, and oauth args.
Also updates the certificates extract task to use remote_src since
the bundle now resides on the target host.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ehelms
ehelms force-pushed the copy-bundle-command branch from a1b33af to 81c28dc Compare July 6, 2026 16:01
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