Skip to content

Conversation

@ehelms
Copy link
Member

@ehelms ehelms commented Oct 2, 2025

Enables foremanctl to authenticate with private registries by checking for auth files before attempting image pulls. Users can run podman login <registry> --authfile=/etc/foreman/registry-auth.json and foremanctl will automatically use the credentials when available.

@ehelms ehelms force-pushed the add-auth-file-support branch from 2926317 to ed0815f Compare October 2, 2025 19:24
---
foreman_container_image: "quay.io/foreman/foreman"
foreman_container_tag: "nightly"
foreman_registry_auth_file: /etc/foreman/registry-auth.json

Choose a reason for hiding this comment

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

Wouldn’t it be better to define this variable globally, either in the inventory or in ansible.cfg, instead of setting it as a role default for all containers?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we wish to customize this at some point, we would add a top-level one. Based on the layers of our design, each role should have it's own namespaced variable.

- python3-requests
roles:
- role: checks
- pre_install

Choose a reason for hiding this comment

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

Suggested change
- pre_install
- role: pre_install

@ehelms ehelms force-pushed the add-auth-file-support branch from ed0815f to cf006d9 Compare December 4, 2025 13:05
Signed-off-by: Eric D. Helms <ericdhelms@gmail.com>
sudo chmod 600 /etc/foreman/registry-auth.json
sudo chown root:root /etc/foreman/registry-auth.json
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we need to patch the pull-images code as well?

- python3-psycopg2
- python3-requests

- name: Create foreman configuration directory
Copy link
Contributor

Choose a reason for hiding this comment

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

In my testing this directory is created with those permissions when running the pre-requisite of:

podman login <registry> --authfile=/etc/foreman/registry-auth.json

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.

3 participants