Skip to content

Add pulp-cli support - #997

Draft
vsedmik wants to merge 1 commit into
theforeman:masterfrom
vsedmik:pulp-cli
Draft

vsedmik wants to merge 1 commit into
theforeman:masterfrom
vsedmik:pulp-cli

Conversation

@vsedmik

@vsedmik vsedmik commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

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

Foremanctl does not currently install or configure Pulp CLI, leaving it unavailable for troubleshooting containerized Satellite deployments.

Related Jira: SAT-50686 — Add pulp-cli as a feature in foremanctl (https://redhat.atlassian.net/browse/SAT-50686)

What are the changes introduced in this pull request?

  • Add an optional pulp-cli feature, dependent on Pulp and enabled by default in the Satellite flavor.
  • Add a pulp_cli role that installs the CLI RPM directly on the host.
  • Configure /etc/pulp/cli.toml with the deployment URL and existing client certificate/key. Enable TLS verification by adding the server CA to the host trust store.
  • Document root-only usage and persistent local overrides through /root/.config/pulp/cli.toml.
  • Temporarily source the CLI and its dependencies from the upstream pulpcore nightly repository. The repository remains disabled except during the installation transaction and can be removed once the packages
    are available in the normal Satellite repositories.
    • GPG checking is disabled for this temporary repository because its advertised signing-key URL currently returns HTTP 404.
  • Add unit and integration tests, update Satellite’s expected feature set, and document troubleshooting and configuration.

How to test this pull request

Steps to reproduce:

  • Using the updated code against an existing Foreman/Katello deployment, enable the feature:
      ./foremanctl deploy --add-feature pulp-cli
    Satellite deployments should enable it by default.
  • As root on the deployed server, verify installation and API access:
      pulp --version
      pulp config validate --location /etc/pulp/cli.toml
      pulp status
      pulp task list --limit 1
  • Confirm /etc/pulp/cli.toml contains the expected URL and certificate paths with verify_ssl = true.
  • Optionally configure format = "yaml" under [cli] in /root/.config/pulp/cli.toml. Confirm pulp status uses YAML while pulp --format json status uses JSON.
  • Repeat deployment and verify that the pulp_cli role reports no changes.
  • With the test inventory and SSH configuration prepared, run:
      python -m pytest tests/unit/pulp_cli_test.py tests/feature/pulp-cli/base_test.py -vv

Validation performed: 88 unit tests, five live integration tests, Ansible lint, and Ruff passed. Live validation used the local role against an existing Satellite instance, including an idempotency check; it
did not replace the instance’s installed foremanctl or run a full deployment.

Checklist

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

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@ehelms

ehelms commented Nov 24, 2026

Copy link
Copy Markdown
Member

I thought the agreed solution was just to use pulp-cli from the pulp container if needed?

@vsedmik

vsedmik commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

I thought the agreed solution was just to use pulp-cli from the pulp container if needed?

I was aware that running the CLI inside the Pulp container had been discussed, but I hadn’t seen a final decision. Could you point me to that agreement?

One workflow I’d like to preserve is running the CLI on Satellite against registered external Capsules, using [cli-capsule] profiles and pulp --profile capsule ....

This is technically possible with a containerized CLI too, but we would need to make the profiles, client credentials, and CA certificates available inside the container. With host installation, root can configure these directly on the host without additional container mounts or permission handling. It also avoids depending on the local Pulp container being running when troubleshooting a remote Capsule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants