Add foreman_ansible - #444
Conversation
64e0224 to
e06a7f9
Compare
|
This relies on theforeman/foreman-oci-images#25 first |
|
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.: |
adamruzicka
left a comment
There was a problem hiding this comment.
@ehelms what are your plans with this?
ba72146 to
b1c30e7
Compare
594cbd5 to
f3de969
Compare
4321df6 to
6a330e3
Compare
|
@adamruzicka I cleaned up what I disliked, but would now require someone with Ansible knowledge to look at this :) |
adamruzicka
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
| Volume=/var/lib/foreman-proxy/ansible/roles:/etc/ansible/roles:rw,Z,U | ||
| Volume=/var/lib/foreman-proxy/ansible/collections:/etc/ansible/collections:rw,Z,U |
There was a problem hiding this comment.
Why rw? I'd expect the proxy to only consume the content that's there.
Also til about U, nice.
| export ANSIBLE_LOCAL_TEMP="/tmp" | ||
| export ANSIBLE_HOST_KEY_CHECKING="False" | ||
| export ANSIBLE_ROLES_PATH="/etc/ansible/roles:/usr/share/ansible/roles" | ||
| export ANSIBLE_COLLECTIONS_PATHS="/etc/ansible/collections:/usr/share/ansible/collections" |
There was a problem hiding this comment.
[DEPRECATION WARNING]:
ANSIBLE_COLLECTIONS_PATHS option, does not fit var naming standard, use the singular form ANSIBLE_COLLECTIONS_PATH instead. This feature will be removed from ansible-core in version 2.19. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
| export ANSIBLE_COLLECTIONS_PATHS="/etc/ansible/collections:/usr/share/ansible/collections" | |
| export ANSIBLE_COLLECTIONS_PATH="/etc/ansible/collections:/usr/share/ansible/collections" |
| @@ -0,0 +1,13 @@ | |||
| export ANSIBLE_CALLBACK_WHITELIST="theforeman.foreman.foreman" | |||
There was a problem hiding this comment.
Iirc whitelist was replaced with the one below in ansible 2.15. It should be safe to drop this one.
| export ANSIBLE_CALLBACK_WHITELIST="theforeman.foreman.foreman" |
| ROLE_NAME = "theforeman.foremanctltest" | ||
|
|
||
|
|
||
| def test_foreman_ansible_plugin_installed(foremanapi): |
There was a problem hiding this comment.
that's a shiny mirror you have there. where did you get it?
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f7c4467 to
2f0f2c4
Compare
No description provided.