Commit Graph

25 Commits (0f962dba14d1d51c6546a2065417958048bd98b9)

Author SHA1 Message Date
Stoned Elipot 4430d0f5a6 when searching for a plugin only look for a regular file 2013-10-16 21:23:37 +02:00
Ustun Ozgur 977b31249a Update cache check in find_plugin
I am not familiar with the internals, but this line looked suspicious.
2013-09-29 14:03:10 +03:00
James Cammarata a202adcae1 Merge branch 'doublecallback' of https://github.com/sergevanginderachter/ansible into sergevanginderachter-doublecallback 2013-09-04 09:58:06 -05:00
Brian Harring 902183ac0e Enforce alphanumeric ordering for plugins grabbed via glob.
If this isn't done, it's left to directory ordering which can result
in indeterminent behaviour.
2013-08-19 19:48:17 -04:00
Serge van Ginderachter 173586b871 Ensure plugin_loader.all() only loads one instance
by ensuring all basedirs, plugin paths and extra
paths are handled as absolute paths and are checked
to not add any doubles.

This fixes the corner case where e.g. the user has
an additional plugin path configured to a dir
relative to his playbooks or inventory location,
which also matches the  _plugin subdir relative to
one of the basedirs in the play.

For most plugins this doesn't show as an obvious issue
except for callback_plugins, which might fire more
than once. Other plugins (inventory and template
plugins) might unnecessarily be ran twice.

e.g. ansible.cfg has
callback_plugins   = ./plays/callback_plugins
and plays/ contains a playbook file:
.
├── ansible.cfg
├── inventory
└── plays
    ├── callback_plugins
    │   └── timestamp.py
    └── site.yml

modified:   lib/ansible/utils/plugins.py
2013-08-12 22:17:53 +02:00
Stoned Elipot 841093921b Add extra module path early during playbook parsing.
This should fix issue #3668

Also prevent an extra module path to be added multiple times.
2013-07-28 18:47:26 +02:00
Michael DeHaan 9db4f7a9a6 Makes host key checking the default behavior but can be disabled in ansible.cfg or by environment variable. 2013-07-03 16:47:20 -04:00
Michael DeHaan 98e7eaf07a Merge pull request #3316 from dsedivec/devel
expanduser on each component of plug-in paths
2013-06-30 09:12:15 -07:00
Stoned Elipot b7f89837bb Remove redundant call to _get_path() in PluginLoader.find_plugin() 2013-06-30 16:38:26 +02:00
Dale Sedivec b32131c867 expanduser on each component of plug-in paths
ansible.constants was calling expanduser (by way of shell_expand_path)
on the entire configured value for the library and *_plugins
configuration values, but these values have always been interpreted as
multiple directories separated by os.pathsep.  Thus, if you supplied
multiple directories for one of these values, typically only the first
(at least on *nix) would have e.g. "~" expanded to HOME.

Now PluginLoader does expansion on each individual path in each of
these variables.
2013-06-22 17:01:12 -05:00
Serge van Ginderachter 2a7f9df109 add support for callback_plugins/ relative to playbook 2013-06-12 23:54:00 +02:00
Dale Sedivec 611d56dc4c Plug-ins loaded from top-level plug-in directory
PluginLoader._get_paths, as of 391fb98e, was only finding plug-ins that
were in a subdirectory of one of the basedirs (i.e. in a category
directory).  For example, action_plugins/foo.py would never be loaded,
but action_plugins/bar/foo.py would work.

This makes it so that "uncategorized" plug-ins in the top level of a
directory such as action_plugins will be loaded, though plug-ins in a
"category" subdirectory will still be preferred.  For example,
action_plugins/bar/foo.py would be preferred over action_plugins/foo.py.
2013-05-24 17:05:28 -05:00
Michael DeHaan 753ebea186 Prefer categorized modules to uncategorized, such that if someone does an install on top of old content
the categorized modules will win over the 1.1 uncategorized modules, as the packages may not automatically
clean up the old content.
2013-05-19 20:09:44 -04:00
Michael DeHaan 68f711d5ae teach plugin loader to find modules in subdirectories 2013-04-28 15:22:46 -04:00
Michael DeHaan 391fb98ee2 Allow modules to be categorized, and also sort them when generating the documentation. 2013-04-28 15:03:45 -04:00
Michael DeHaan d7623d1f91 Added a 'set_up' and 'tear_down' which are like tasks, but execute before and after roles. 2013-04-20 16:07:06 -04:00
Michael DeHaan e6bf01a6b0 Make plugin loader path operations more efficient. 2013-04-20 12:31:14 -04:00
Michael DeHaan 53ac0bbec2 Instantiate callback plugins only once so we can set play/task objects on them and they'll stick. 2013-04-20 09:09:35 -04:00
Daniel Hokka Zakrisson f1eb195ff5 vars_loader should get the path to the inventory + vars_plugins 2013-03-01 23:22:52 +01:00
Bowe Strickland 2b3d6d4545 protect PluginLoader._extra_dirs from appending None
PluginLoader.add_directory() can receive None from, for example, 
Inventory.add_directory(self.basedir()) if host_list is a custom list.
None has no reasonable interpretation other than ignore it.
2013-01-23 13:55:12 -05:00
Daniel Hokka Zakrisson d4c63e3300 Ensure each basedir is only added to the search path once
Fixes #1790.
2012-12-20 14:17:12 +01:00
Daniel Hokka Zakrisson f95fefd8c5 Use plugin system to find modules 2012-11-18 19:09:21 +01:00
Daniel Hokka Zakrisson 5dd2ec2cae Add a way to add directories to just one type of loader 2012-11-18 19:08:59 +01:00
Jeroen Hoekx 8ffed6df75 Support custom jinja2 filters.
This uses the plugin framework to add filter plugins.
The previously hardcoded core filters are defined using the plugin
framework now.
2012-11-05 15:11:34 +01:00
Daniel Hokka Zakrisson e05e514861 Create a plugin loader system 2012-11-02 01:24:14 +01:00