From 7117ca5395bf3991cb70f2c474473cd4f59e5be0 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 28 Apr 2013 21:05:19 -0400 Subject: [PATCH] Allow modules in a "./library" directory to be referenced by their shortforms "modulename:" instead of just "action: modulename" --- lib/ansible/playbook/task.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index af297b9f3a..45dde4466a 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -17,6 +17,7 @@ from ansible import errors from ansible import utils +import os import ansible.utils.template as template class Task(object): @@ -53,6 +54,11 @@ class Task(object): else: self.meta = None + + library = os.path.join(play.basedir, 'library') + if os.path.exists(library): + utils.plugins.module_finder.add_directory(library) + for x in ds.keys(): # code to allow for saying "modulename: args" versus "action: modulename args"