Skip to content

Add foreman_ansible - #444

Merged
evgeni merged 11 commits into
theforeman:masterfrom
ehelms:add-foreman-ansible
Aug 3, 2026
Merged

Add foreman_ansible#444
evgeni merged 11 commits into
theforeman:masterfrom
ehelms:add-foreman-ansible

Conversation

@ehelms

@ehelms ehelms commented Apr 2, 2026

Copy link
Copy Markdown
Member

No description provided.

Comment thread src/features.yaml Outdated
@ehelms

ehelms commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

This relies on theforeman/foreman-oci-images#25 first

Comment thread .github/workflows/test.yml Outdated
@ehelms

ehelms commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

I started adding this to help ensure the IoP use-case could work out of the box by having ansible support for remediation. There is more nuance and testing for this feature that needs to happen to be complete.

When I test this locally with the updated containers built locally, I run into the hammer sync failing with no clear reason why. That will need investigation, i.e.:

hammer ansible roles sync

Comment thread tests/foreman_ansible_test.py Outdated
Comment thread tests/feature/ansible/base_test.py

@adamruzicka adamruzicka left a comment

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.

@ehelms what are your plans with this?

Comment thread src/roles/foreman_proxy/templates/settings.d/ansible.yml.j2 Outdated
@ehelms
ehelms force-pushed the add-foreman-ansible branch 4 times, most recently from ba72146 to b1c30e7 Compare July 24, 2026 01:00
@evgeni
evgeni force-pushed the add-foreman-ansible branch 2 times, most recently from 594cbd5 to f3de969 Compare July 28, 2026 14:58
Comment thread tests/feature/ansible/base_test.py Outdated
Comment thread tests/feature/ansible/base_test.py Outdated
Comment thread tests/feature/ansible/base_test.py Outdated
Comment thread src/features.yaml Outdated
Comment thread tests/feature/ansible/base_test.py Outdated
@evgeni
evgeni force-pushed the add-foreman-ansible branch 3 times, most recently from 4321df6 to 6a330e3 Compare July 29, 2026 08:44
@evgeni

evgeni commented Jul 29, 2026

Copy link
Copy Markdown
Member

@adamruzicka I cleaned up what I disliked, but would now require someone with Ansible knowledge to look at this :)

@adamruzicka adamruzicka left a comment

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.

Seems to work well (ad-hoc rex-like jobs, role management, role application, reports from roles). Some minor suggestions inline


- name: Create ansible roles directory
ansible.builtin.file:
path: /var/lib/foreman-proxy/ansible/roles

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.

Previously we relied on /etc/ansible/roles for "user roles" (and s/role/collection/g). Having everthing in /var/lib would be cleaner, but also make the migration harder. Personally I'd be willing to make that tradeoff, but still worth calling out.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do like that it's separated from the Ansible of the host, which might (intentionally or not) contain other content too

Comment thread src/roles/foreman_proxy/tasks/feature/ansible.yaml Outdated
Comment thread src/roles/foreman_proxy/templates/ansible.env.j2 Outdated
Comment thread src/roles/foreman_proxy/templates/ansible.env.j2 Outdated
Comment thread tests/feature/ansible/base_test.py Outdated
ROLE_NAME = "theforeman.foremanctltest"


def test_foreman_ansible_plugin_installed(foremanapi):

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that's a shiny mirror you have there. where did you get it?

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@evgeni
evgeni force-pushed the add-foreman-ansible branch from f7c4467 to 2f0f2c4 Compare July 30, 2026 15:44
@evgeni

evgeni commented Jul 31, 2026

Copy link
Copy Markdown
Member

@adamruzicka addressed all your code-comments

@adamruzicka adamruzicka left a comment

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.

This is good. There will be a followup or two to close the feature gap, but this is a good start.

@evgeni
evgeni merged commit 6415f9b into theforeman:master Aug 3, 2026
26 of 29 checks passed
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.

6 participants