Skip to content

Commit

Permalink
add local plugins first when processing playbook directories
Browse files Browse the repository at this point in the history
playbooks (tests are considered playbooks) may have local modules
and other plugins.  Process these first before processing the playbooks.
Then, process possible role directories under the playbook directory,
but do not treat it as a "real" role directory.
  • Loading branch information
richm committed Jan 24, 2024
1 parent c1309db commit 8993e7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions report-modules-plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,13 @@ def process_role_meta_path(meta_path, ctx):


def process_playbooks_path(playbooks_path, ctx):
# see if there are any local plugins first
ctx.add_local_plugins(playbooks_path, "library")
ctx.add_local_plugins(playbooks_path, "filter_plugins")
for _, itempath in os_listdir(playbooks_path):
if os.path.isfile(itempath):
process_ansible_file(itempath, ctx)
# treat it like a role - look for vars/, tasks/, etc.
process_role(playbooks_path, True, ctx)
process_role(playbooks_path, False, ctx)


def process_role_tests_path(tests_path, ctx):
Expand Down

0 comments on commit 8993e7c

Please sign in to comment.