From a4d01b0891ea87f9bb186d2a0ed7dcc760e88abc Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 6 Mar 2014 21:47:49 -0500 Subject: [PATCH] Also search .json filenames --- lib/ansible/constants.py | 4 ++-- lib/ansible/playbook/play.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 94070f641f..6bf87e51f8 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -93,8 +93,8 @@ else: DIST_MODULE_PATH = '/usr/share/ansible/' # check all of these extensions when looking for yaml files for things like -# group variables -YAML_FILENAME_EXTENSIONS = [ "", ".yml", ".yaml" ] +# group variables -- really anything we can load +YAML_FILENAME_EXTENSIONS = [ "", ".yml", ".yaml", ".json" ] # sections in config file DEFAULTS='defaults' diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index aaa7935882..41f246cbbb 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -448,6 +448,7 @@ class Play(object): os.path.join(basepath, 'main'), os.path.join(basepath, 'main.yml'), os.path.join(basepath, 'main.yaml'), + os.path.join(basepath, 'main.json'), ) if sum([os.path.isfile(x) for x in mains]) > 1: raise errors.AnsibleError("found multiple main files at %s, only one allowed" % (basepath))