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

Template plugin config #58288

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from
Open

Template plugin config #58288

wants to merge 4 commits into from

Conversation

@bcoca
Copy link
Member

@bcoca bcoca commented Jun 24, 2019

Enable templating for inventory plugin config options

Fixes #58281

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

inventory

@ansibot

This comment has been hidden.

lib/ansible/plugins/inventory/__init__.py Outdated Show resolved Hide resolved
Loading
lib/ansible/plugins/inventory/__init__.py Outdated Show resolved Hide resolved
Loading
@bcoca bcoca force-pushed the template_inv_options branch from 6d9ba52 to ec57c4f Jun 25, 2019
lib/ansible/plugins/inventory/__init__.py Outdated Show resolved Hide resolved
Loading
@bcoca bcoca force-pushed the template_inv_options branch from cafdf17 to 13383f9 Jun 25, 2019
lib/ansible/plugins/inventory/__init__.py Outdated Show resolved Hide resolved
Loading
if self.templar.is_template(value):
value = self.templar.template(value)

if getattr(value, '__ENCRYPTED__', False):
Copy link
Contributor

@s-hertel s-hertel Feb 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this in config manager now for string types https://github.com/ansible/ansible/blob/stable-2.10/lib/ansible/config/manager.py#L147-L155

I think this just needs a way to enable/disable templating? Maybe at the plugin level and option level, so a plugin needs to opt into it but can still disable it for static options.

(And maybe still need to disable lookup plugins?)

Loading

@tedsteen
Copy link

@tedsteen tedsteen commented May 27, 2021

This is the end of the road if you're looking for a way to encrypt single values in an inventory plugin.
Is this solved elsewhere or put on ice?

Loading

@bcoca
Copy link
Member Author

@bcoca bcoca commented May 27, 2021

i hit a wall, but should be able to come back to this soonish

Loading

@tedsteen
Copy link

@tedsteen tedsteen commented May 28, 2021

i hit a wall, but should be able to come back to this soonish

My 2c.
It's almost always the case that you want to encrypt some kind of token to the source of the inventory. That being said you can still encrypt the entire file.

Loading

@briantist
Copy link
Contributor

@briantist briantist commented May 31, 2021

@bcoca It looks like this PR only affects inventory plugins. Any chance it could it be extended for lookups as referenced in #73268 ?

Loading

@bcoca
Copy link
Member Author

@bcoca bcoca commented Jun 1, 2021

@briantist, yes, that has been my intention for a while now, any plugin that could require auth (vars, inventory, callback, cache and lookup are the ones that came to mind)

Loading

@b-reich
Copy link

@b-reich b-reich commented Jul 1, 2021

Is there a way to help you?

Loading

@bcoca bcoca changed the title [WIP] Template inv options Template plugin config Jul 6, 2021
@ansibot ansibot added needs_revision and removed WIP labels Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

8 participants