mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-22 04:40:42 +00:00
add custom modules auto-detection
This commit is contained in:
parent
bec9789649
commit
d7dac43a72
@ -1,6 +1,2 @@
|
|||||||
* BUGFIX
|
* ENHANCEMENT
|
||||||
* fix typo in argparse description
|
* add custom modules auto-detection
|
||||||
* INTERNAL
|
|
||||||
* add markdown linting to CI (markdownlint-cli)
|
|
||||||
* add spellchecking to CI (spellcheck-cli)
|
|
||||||
* add broken link check to CI (broken-link-checker)
|
|
||||||
|
@ -88,6 +88,19 @@ class Settings(object):
|
|||||||
if cli_options and self._validate(cli_options):
|
if cli_options and self._validate(cli_options):
|
||||||
anyconfig.merge(defaults, cli_options, ac_merge=anyconfig.MS_DICTS)
|
anyconfig.merge(defaults, cli_options, ac_merge=anyconfig.MS_DICTS)
|
||||||
|
|
||||||
|
library = os.path.relpath(os.path.normpath(os.path.join(os.getcwd(), "library")))
|
||||||
|
autodetect = []
|
||||||
|
if os.path.exists(library):
|
||||||
|
autodetect = [
|
||||||
|
os.path.splitext(f)[0]
|
||||||
|
for f in os.listdir(library)
|
||||||
|
if os.path.isfile(os.path.join(library, f)) and not f.startswith(".")
|
||||||
|
]
|
||||||
|
|
||||||
|
for f in autodetect:
|
||||||
|
if f not in defaults["ansible"]["custom_modules"]:
|
||||||
|
defaults["ansible"]["custom_modules"].append(f)
|
||||||
|
|
||||||
return defaults
|
return defaults
|
||||||
|
|
||||||
def _get_defaults(self):
|
def _get_defaults(self):
|
||||||
|
@ -8,9 +8,10 @@ title: Default settings
|
|||||||
{{< highlight YAML "linenos=table" >}}
|
{{< highlight YAML "linenos=table" >}}
|
||||||
---
|
---
|
||||||
ansible:
|
ansible:
|
||||||
# Add the name of used custom Ansible modules.
|
# Add the name of used custom Ansible modules. Otherwise ansible-later
|
||||||
# Otherwise ansible-later can't detect unknown modules
|
# can't detect unknown modules and will through an error.
|
||||||
# and will through an error.
|
# Modules which are bundled with the role and placed in a './library'
|
||||||
|
# directory will be auto-detected and don't need to be added to this list.
|
||||||
custom_modules: []
|
custom_modules: []
|
||||||
# Settings for variable formatting rule (ANSIBLE0004)
|
# Settings for variable formatting rule (ANSIBLE0004)
|
||||||
double-braces:
|
double-braces:
|
||||||
|
Loading…
Reference in New Issue
Block a user