mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Also search .json filenames
This commit is contained in:
parent
79799f6819
commit
a4d01b0891
2 changed files with 3 additions and 2 deletions
|
@ -93,8 +93,8 @@ else:
|
||||||
DIST_MODULE_PATH = '/usr/share/ansible/'
|
DIST_MODULE_PATH = '/usr/share/ansible/'
|
||||||
|
|
||||||
# check all of these extensions when looking for yaml files for things like
|
# check all of these extensions when looking for yaml files for things like
|
||||||
# group variables
|
# group variables -- really anything we can load
|
||||||
YAML_FILENAME_EXTENSIONS = [ "", ".yml", ".yaml" ]
|
YAML_FILENAME_EXTENSIONS = [ "", ".yml", ".yaml", ".json" ]
|
||||||
|
|
||||||
# sections in config file
|
# sections in config file
|
||||||
DEFAULTS='defaults'
|
DEFAULTS='defaults'
|
||||||
|
|
|
@ -448,6 +448,7 @@ class Play(object):
|
||||||
os.path.join(basepath, 'main'),
|
os.path.join(basepath, 'main'),
|
||||||
os.path.join(basepath, 'main.yml'),
|
os.path.join(basepath, 'main.yml'),
|
||||||
os.path.join(basepath, 'main.yaml'),
|
os.path.join(basepath, 'main.yaml'),
|
||||||
|
os.path.join(basepath, 'main.json'),
|
||||||
)
|
)
|
||||||
if sum([os.path.isfile(x) for x in mains]) > 1:
|
if sum([os.path.isfile(x) for x in mains]) > 1:
|
||||||
raise errors.AnsibleError("found multiple main files at %s, only one allowed" % (basepath))
|
raise errors.AnsibleError("found multiple main files at %s, only one allowed" % (basepath))
|
||||||
|
|
Loading…
Reference in a new issue