Bug 2025523
Summary: | Ansible roles are not starting automatically after provisioning | |||
---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Stefan Meyer <smeyer> | |
Component: | Ansible - Configuration Management | Assignee: | satellite6-bugs <satellite6-bugs> | |
Status: | CLOSED ERRATA | QA Contact: | Sam Bible <sbible> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 6.10.0 | CC: | aeladawy, ahumbe, ajambhul, amarirom, aruzicka, bo.neace, dominic.kohls, gstogian, jangerrit.kootstra, ktordeur, ldelouw, lzap, matthew.lesieur, mhulan, micmurph, momran, oezr, onerleka, pmendezh, satellite6-bugs, saydas, smajumda, thomas.wimmer, yferszt | |
Target Milestone: | 6.11.0 | Keywords: | PrioBumpGSS, Triaged | |
Target Release: | Unused | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 2043701 (view as bug list) | Environment: | ||
Last Closed: | 2022-07-05 14:30:29 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: |
Description
Stefan Meyer
2021-11-22 12:46:52 UTC
Hi, we are requesting a status update. Thanks. From customer: Ideally we would like to be able to build servers with no manual intervention beyond pressing a button. This makes it so someone has to manually run a Run All Ansible Roles job on a server after it is built. I'm wondering if it might be possible to put in some sort of workaround, possibly using foreman_webhooks. Hey guys, as this bug is not yet fixed in satellite 6.10.1, you can apply the following fix from upstream: https://projects.theforeman.org/issues/34110 Change line 112 in file /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.42/app/models/katello/concerns/host_managed_extensions.rb https://projects.theforeman.org/projects/katello/repository/revisions/353ebfc0ab489458a9882c759bb3d7ec6b16f85d/diff/app/models/katello/concerns/host_managed_extensions.rb Best regards! Hello team, We have another Customer that hit the same issue. The workaround has been applied from this Bugzilla but Customer has the following query: The patch made the hook trigger, but how do we pass the name of the host to the hook? When using an URL like this (which works for "Host updated" event): https://satellite.example.com/svv/provisioning/webhooks/build-exit/<%= @object.name %> we get the following error: Backtrace for 'undefined method '#name' for NilClass::Jail (NilClass)' error (Safemode::NoMethodError): undefined method '#name' for NilClass::Jail (NilClass) The question (and cause for needinfo) in #22 is not really related to this BZ in any way, sorry for derailing the thread. If you reach out to us we'll always try to help, but raising needinfos on sat6-bugs is not the best way, there are better communication channels for this. > When using an URL like this (which works for "Host updated" event): The event triggered when a host is updated carries the whole host as @object so you can use @object.name on it. > but how do we pass the name of the host to the hook? If I'm reading things right then build status changes carry only the id and hostname of the host as @id and @hostname respectively, so you should be able to do https://satellite.example.com/svv/provisioning/webhooks/build-exit/<%= @hostname %> *** Bug 2053451 has been marked as a duplicate of this bug. *** Version-Release number of selected component (if applicable): - Satellite 6.11 - 18 Steps to Reproduce: 1. Create a host group with default Ansible roles. 1. Deploy a new host under that host group. Actual results: - A job running the hostgroup's ansible roles was scheduled. Expected results: - A job to run all assigned Ansible roles should be scheduled Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5498 |