Skip to content
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

Support vars plugins in collections #61078

Open
wants to merge 9 commits into
base: devel
from

Conversation

@s-hertel
Copy link
Contributor

commented Aug 21, 2019

SUMMARY

Vars plugins were previously ignored in collections

This allows developers to require whitelisting for their vars plugin and users to control when vars plugins are executed.

The plugins themselves control whether or not whitelisting is required. Third-party plugins will continue to run by default unless they add whitelisting support. Since PluginLoader.all() does not search collections, vars plugins in collections will need to be in the list of enabled vars plugins. The host_group_vars plugin is now requires whitelisting and is whitelisted by default.

There are two new settings to control when vars plugins run and they default to the current behavior. They can be used in tandem or separately. RUN_VARS_PLUGINS is a global setting that determines whether to run vars plugins anytime variables are 'demanded' by tasks, or just at the 'start' after importing an inventory source. The other setting 'stage' is vars plugin specific and can be set in ansible.cfg or an env var.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Vars plugins

bcoca and others added 4 commits Nov 1, 2018
move var plugins hanlding to own file
	- add whitelisting
	- add 'stage' configuration ('all', 'task', 'inventory') for users to control when they execute.
	- TODO:
		- update ansible-inventory (when playbook dir) and InventoryManager to use them
		- update config, default to host_group_vars, update plugin to use 'stage' config
Add whitelisting and enable host_group_vars by default
Update vars plugins to use config manager and add stage configuration

Update ansible-inventory to share code and use stage

Update host_group_vars to use stage
fix bad copy pasta
ci_complete

@s-hertel s-hertel force-pushed the s-hertel:collection_vars_plugins branch from d05b1e8 to 6adea0a Aug 21, 2019

@s-hertel s-hertel force-pushed the s-hertel:collection_vars_plugins branch from 83fe042 to 26d4253 Aug 21, 2019

@ansibot ansibot added core_review and removed needs_revision labels Aug 22, 2019

@s-hertel s-hertel force-pushed the s-hertel:collection_vars_plugins branch from 03a6de7 to baec514 Aug 22, 2019

@ansibot

This comment was marked as resolved.

Copy link
Contributor

commented Aug 22, 2019

The test ansible-test sanity --test future-import-boilerplate [explain] failed with 1 error:

lib/ansible/plugins/doc_fragments/vars_plugin_staging.py:0:0: missing: from __future__ import (absolute_import, division, print_function)

The test ansible-test sanity --test metaclass-boilerplate [explain] failed with 1 error:

lib/ansible/plugins/doc_fragments/vars_plugin_staging.py:0:0: missing: __metaclass__ = type

click here for bot help

Move has_option to AnsiblePlugin
Use a doc fragment for vars plugins

use vars_ sections

boilerplate

@s-hertel s-hertel force-pushed the s-hertel:collection_vars_plugins branch from e64aa76 to 4c23f2e Aug 22, 2019

@ansibot ansibot added core_review and removed needs_revision labels Aug 22, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Sep 6, 2019

@s-hertel can you please add an example entry to the collection doc

@bcoca bcoca moved this from To do to In progress in 2.9 post beta firedrills Sep 6, 2019

@ansibot ansibot removed the stale_ci label Sep 6, 2019

@jctanner jctanner removed this from In progress in 2.9 post beta firedrills Sep 6, 2019

@ansibot ansibot added the stale_ci label Sep 15, 2019

@s-hertel s-hertel force-pushed the s-hertel:collection_vars_plugins branch from 408e8a4 to 6715b11 Sep 17, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.