mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 13:21:25 -07:00
add more consistent extension matching for inventory plugins (#46786)
* Add consistent extension matching for inventory plugins that support YAML configuration files * Document extension matching expectations
This commit is contained in:
parent
e3882ad6f6
commit
f3d5ebb355
9 changed files with 21 additions and 22 deletions
|
@ -16,7 +16,7 @@ DOCUMENTATION = r'''
|
|||
- linode_api4 >= 2.0.0
|
||||
description:
|
||||
- Reads inventories from the Linode API v4.
|
||||
- Uses a C(<name>.linode.yaml) (or C(<name>.linode.yml)) YAML configuration file.
|
||||
- Uses a YAML configuration file that ends with linode.(yml|yaml).
|
||||
- Linode labels are used by default as the hostnames.
|
||||
- The inventory groups are built from groups and not tags.
|
||||
options:
|
||||
|
@ -186,7 +186,7 @@ class InventoryModule(BaseInventoryPlugin):
|
|||
def verify_file(self, path):
|
||||
"""Verify the Linode configuration file."""
|
||||
if super(InventoryModule, self).verify_file(path):
|
||||
endings = ('.linode.yaml', '.linode.yml')
|
||||
endings = ('linode.yaml', 'linode.yml')
|
||||
if any((path.endswith(ending) for ending in endings)):
|
||||
return True
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue