diff options
author | Sloane Hertel <shertel@redhat.com> | 2018-10-11 12:06:52 -0400 |
---|---|---|
committer | Alicia Cozine <879121+acozine@users.noreply.github.com> | 2018-10-11 11:06:52 -0500 |
commit | f3d5ebb355dc6a85ebb0978c7872512de56c85b0 (patch) | |
tree | 97da8a7312d0c4191c99b7894ce7167992f6858f /lib/ansible/plugins/inventory/tower.py | |
parent | e3882ad6f69667ab0f4b287388d029a22b6505d5 (diff) | |
download | ansible-f3d5ebb355dc6a85ebb0978c7872512de56c85b0.tar.gz |
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
Diffstat (limited to 'lib/ansible/plugins/inventory/tower.py')
-rw-r--r-- | lib/ansible/plugins/inventory/tower.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/plugins/inventory/tower.py b/lib/ansible/plugins/inventory/tower.py index 38f04ac50f..79b2776a4d 100644 --- a/lib/ansible/plugins/inventory/tower.py +++ b/lib/ansible/plugins/inventory/tower.py @@ -16,7 +16,7 @@ DOCUMENTATION = ''' description: - Reads inventories from Ansible Tower. - Supports reading configuration from both YAML config file and environment variables. - - If reading from the YAML file, the file name must end with tower_inventory.(yml|yaml), + - If reading from the YAML file, the file name must end with tower.(yml|yaml) or tower_inventory.(yml|yaml), the path in the command would be /path/to/tower_inventory.(yml|yaml). If some arguments in the config file are missing, this plugin will try to fill in missing arguments by reading from environment variables. - If reading configurations from environment variables, the path in the command must be @tower_inventory. @@ -143,7 +143,7 @@ class InventoryModule(BaseInventoryPlugin): self.no_config_file_supplied = True return True elif super(InventoryModule, self).verify_file(path): - return path.endswith('tower_inventory.yml') or path.endswith('tower_inventory.yaml') + return path.endswith(('tower_inventory.yml', 'tower_inventory.yaml', 'tower.yml', 'tower.yaml')) else: return False |