bug fix: using non-FQDN in plugin choices fails plugin name verification (#75991)

* enable both non-FQDN and FQDN plugin name
* add info about matching requirement of plugin name in config and plugin source file
pull/76174/head
Jonas I. Liechti 3 years ago committed by GitHub
parent 3a9e42cfde
commit 0b0acef423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,6 +30,7 @@ If the plugin is in a collection, use the fully qualified name:
[inventory] [inventory]
enable_plugins = namespace.collection_name.inventory_plugin_name enable_plugins = namespace.collection_name.inventory_plugin_name
If you use a plugin that supports a YAML configuration source, make sure that the name matches the name provided in the ``plugin`` entry of the inventory source file.
.. _using_inventory: .. _using_inventory:

@ -18,7 +18,7 @@ DOCUMENTATION = '''
plugin: plugin:
description: token that ensures this is a source file for the 'constructed' plugin. description: token that ensures this is a source file for the 'constructed' plugin.
required: True required: True
choices: ['constructed'] choices: ['ansible.builtin.constructed', 'constructed']
use_vars_plugins: use_vars_plugins:
description: description:
- Normally, for performance reasons, vars plugins get executed after the inventory sources complete the base inventory, - Normally, for performance reasons, vars plugins get executed after the inventory sources complete the base inventory,
@ -36,7 +36,7 @@ DOCUMENTATION = '''
EXAMPLES = r''' EXAMPLES = r'''
# inventory.config file in YAML format # inventory.config file in YAML format
plugin: constructed plugin: ansible.builtin.constructed
strict: False strict: False
compose: compose:
var_sum: var1 + var2 var_sum: var1 + var2

@ -17,7 +17,7 @@ DOCUMENTATION = '''
plugin: plugin:
description: token that ensures this is a source file for the 'generator' plugin. description: token that ensures this is a source file for the 'generator' plugin.
required: True required: True
choices: ['generator'] choices: ['ansible.builtin.generator', 'generator']
hosts: hosts:
description: description:
- The C(name) key is a template used to generate - The C(name) key is a template used to generate
@ -39,7 +39,7 @@ EXAMPLES = '''
# inventory.config file in YAML format # inventory.config file in YAML format
# remember to enable this inventory plugin in the ansible.cfg before using # remember to enable this inventory plugin in the ansible.cfg before using
# View the output using `ansible-inventory -i inventory.config --list` # View the output using `ansible-inventory -i inventory.config --list`
plugin: generator plugin: ansible.builtin.generator
hosts: hosts:
name: "{{ operation }}_{{ application }}_{{ environment }}_runner" name: "{{ operation }}_{{ application }}_{{ environment }}_runner"
parents: parents:

@ -1,3 +1,3 @@
plugin: constructed plugin: ansible.builtin.constructed
groups: groups:
webservers: inventory_hostname.startswith('web') webservers: inventory_hostname.startswith('web')

@ -1,4 +1,4 @@
plugin: constructed plugin: ansible.builtin.constructed
strict: true strict: true
use_extra_vars: True use_extra_vars: True
compose: compose:

@ -1,4 +1,4 @@
plugin: constructed plugin: ansible.builtin.constructed
keyed_groups: keyed_groups:
- key: hostvar0 - key: hostvar0
- key: hostvar1 - key: hostvar1

@ -1,4 +1,4 @@
plugin: constructed plugin: ansible.builtin.constructed
use_vars_plugins: true use_vars_plugins: true
keyed_groups: keyed_groups:
- key: iamdefined - key: iamdefined

@ -1,4 +1,4 @@
plugin: constructed plugin: ansible.builtin.constructed
keyed_groups: keyed_groups:
- key: tags - key: tags
prefix: tag prefix: tag

@ -1,5 +1,5 @@
plugin: constructed plugin: ansible.builtin.constructed
keyed_groups: keyed_groups:
- key: roles - key: roles
default_value: storage default_value: storage
prefix: host prefix: host

@ -1,5 +1,5 @@
plugin: constructed plugin: ansible.builtin.constructed
keyed_groups: keyed_groups:
- key: os - key: os
default_value: "fedora" default_value: "fedora"
prefix: host prefix: host

@ -1,4 +1,4 @@
plugin: constructed plugin: ansible.builtin.constructed
keyed_groups: keyed_groups:
- key: tags - key: tags
prefix: tag prefix: tag

@ -1,4 +1,4 @@
plugin: constructed plugin: ansible.builtin.constructed
keyed_groups: keyed_groups:
- key: hostvar0 - key: hostvar0
- key: hostvar1 - key: hostvar1

Loading…
Cancel
Save