From 899527f3cb9a40592c21f52b86eb8d65832adfb8 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 13 Jul 2017 19:19:34 -0400 Subject: [PATCH] make yaml extensions configurable fixes #25419 --- lib/ansible/config/data/config.yml | 10 ++++++++++ lib/ansible/constants.py | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/ansible/config/data/config.yml b/lib/ansible/config/data/config.yml index 942baa2f09..a1be87bdda 100644 --- a/lib/ansible/config/data/config.yml +++ b/lib/ansible/config/data/config.yml @@ -1405,3 +1405,13 @@ VARIABLE_PRECEDENCE: value_type: list vars: [] yaml: {key: defaults.precedence} +YAML_FILENAME_EXTENSIONS: + default: [".yml", ".yaml", ".json"] + desc: "check all of these extensions when looking for 'variable' files which should be YAML or JSON or vaulted versions of theses." + env: + - name: ANSIBLE_YAML_FILENAME_EXT + ini: + - {key: defaults, section: yaml_valid_extensions} + value_type: list + vars: [] + yaml: {key: defaults.yaml_valid_extensions} diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index a6a4ebd3cd..53f11632dc 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -83,4 +83,3 @@ RESTRICTED_RESULT_KEYS = ['ansible_rsync_path', 'ansible_playbook_python'] TREE_DIR = None VAULT_VERSION_MIN = 1.0 VAULT_VERSION_MAX = 1.0 -YAML_FILENAME_EXTENSIONS = [".yml", ".yaml", ".json"] # check all of these extensions when looking for 'variable' files which should be YAML or JSON.