| |
@@ -68,8 +68,14 @@
|
| |
|
| |
inventory_dir = os.environ.get(
|
| |
"TEST_DYNAMIC_INVENTORY_DIRECTORY", "/usr/share/ansible/inventory")
|
| |
- inventory_ignore_extensions = (
|
| |
- "~", ".orig", ".bak", ".ini", ".cfg", ".retry", ".pyc", ".pyo")
|
| |
+
|
| |
+ ignore_ext_string = os.environ.get(
|
| |
+ "ANSIBLE_INVENTORY_IGNORE", "~, .orig, .bak, .ini, .cfg, .retry, .pyc, .pyo")
|
| |
+ ignore_ext_list = []
|
| |
+ for s in ignore_ext_string.split(','):
|
| |
+ if s.strip():
|
| |
+ ignore_ext_list.append(s.strip())
|
| |
+ inventory_ignore_extensions = tuple(ignore_ext_list)
|
| |
|
| |
merged = Inventory()
|
| |
|
| |
A small improvement to allow an environment variable override of ignored file extensions conforming with ansible's inventory conventions.
Thanks to @cevich for the idea!