-
Notifications
You must be signed in to change notification settings - Fork 19
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
[WIP] Inventory override of fact gathering action #17
Comments
Does this proposal assume the module doesn't need any arguments passed to it in order to run? |
currently there is no way to pass arguments at 'gather_facts' |
Interesting point- IIRC most of @privateip's network modules require various extra args to work... I guess this comes back to needing some way to patch things through from inventory automatically. Unfortunately, the other ideas discussed around that wouldn't necessarily solve this case (eg, block-level inventory arg maps, adding playbook-level args to gather_facts), as we're allowing the setup module itself to be abstracted at inventory, so potentially different args needed per host. |
Thinking of the interface:
Would execute Still thinking on how to pass arguments, I'm back to the auth_plugins that would take care of this for all matching modules in a run, but they would have to run prior to fact gathering. |
I'd vote for less "magic" in the names (eg, don't turn "ios" into "ios_facts", just specify "ios_facts"). |
ok, but i would still try to restrict it to _facts modules ... don't want to run 'parted' as part of fact gathering |
At some point when is this even advantageous as opposed to just making your On Mon, Jul 25, 2016 at 2:03 PM, Brian Coca [email protected]
|
not as much on a single play, it is good for an override, my initial thought was being able to set this in config and/or inventory so as not to repeat on every play. |
I've never been a big fan of most automagic behavior, as it causes a lot of questions and corner cases, so you can imagine how I feel about this one. :) |
Explicit is better than implicit. Especially a best practice for Ansible 👍 |
I like the idea of being able to add fact gatherers for custom facts. We're currently adding items for use with our CMDB in a separate module. |
implemented by ansible/ansible#49399 in Ansible 2.8 - closing |
Proposal: Inventory override of fact gathering action
Author: Matt Davis @nitzmahone
Date: 2016/05/20
Motivation
The current automatic fact gathering action (setup) must often be disabled for non-Unix target platforms, since it cannot be reliably overridden without breaking fact gathering for other platforms. Some platforms (eg, Windows) collude with a connection plugin to filter fact modules by file extension, but this behavior won't work for many other platforms (eg, networking) and may eventually break for Windows as well for non-Powershell setup modules or ssh-on-Windows.
Problems
What problems exist that this proposal will solve?
Solution proposal
Add support for a new inventory variable,
ansible_fact_action
, which will allow inventory-level override of the default fact gathering action (setup). Normal action resolution will be performed on the named action, allowing for control-side execution of an action_plugin for fact gathering if desired- otherwise falling back to module resolution.Testing
The new feature will require expanded unit/integration test coverage
Documentation
The final solution should include explicit documentation on how to write fact actions/modules, and how subsets (and any other fact-gathering alterations/args) are to be passed.
The text was updated successfully, but these errors were encountered: