-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to disable callbacks for localhost-like entries #1527
Comments
You can disable the callback using an environment variable: Would that suffice? |
That would technically accomplish the task, but ergonomically it's a pain. On top of our team having to add edit: I'm happy to take a stab at implementing this, doesn't look too complicated on first glance. Just wanted to report first to make sure my PR would even be considered. |
So I must admit I don't like the idea that the filtering should happen in the callback, but I also do see how the existing solutions are not really optimal for you either. Just to re-iterate, you can't set the From a bit of searching, I couldn't find a way to tell Ansible to filter things (read: not to execute the callback for that specific host at all) and also no other callback that handles "remote reporting" (like to a logging system or chat or whatever) does support filtering either :( Should Foreman itself gain a "here is a list/regex/whatever that you should not create hosts for"? I'll ask @ares later when I see him. |
I wasn't aware of those two Foreman options, and at first glance they might work. We manually create hosts with playbooks for bare-metal provisioning or I do agree with you though, this sounds like something that Ansible should implement globally for callback plugins. I can totally see how I'd want the same feature on a logging callback. I'll mull this over a few days and discuss with the team if we can think of any situations where we need the callback to create hosts. Thanks for the help. |
Coming back to this, the admin options are working fine, but I do receive this rather ugly warning:
I don't think that Ansible provides a global "ignore warnings" setting, and I can't think of a nice way to hide this error if it's working as intended. I wonder if maybe an What do you think? |
Ah, yes, the host doesn't exist and you try to submit facts for it, that makes sense. To make sure, can you post the full traceback from /var/log/foreman/production.log? |
Absolutely:
|
SUMMARY
Callback plugin works great when targets are nodes from an inventory (using foreman inventory). When running playbooks that use
hosts: localhost
(configuring foreman itself, or any playbook to be run locally), you end up with alocalhost
host object in Foreman that must be deleted. Every subsequent run adds anotherlocalhost
host.I'd like a way make localhost runs not report facts to foreman. Either built-in, or an
ignore_host = <regex>
-like option in the callback settings.Thanks for all the work on this system!
ISSUE TYPE
The text was updated successfully, but these errors were encountered: