From 3c33273071474d1382da95642cc96b8a7579aec9 Mon Sep 17 00:00:00 2001 From: Pedro Romano Date: Fri, 16 Aug 2013 12:01:56 +0100 Subject: [PATCH] New module argument to specify the executable used for running 'easy_install'. This allows support for system installation of packages on systems with multiple installations of Python. --- library/packaging/easy_install | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/packaging/easy_install b/library/packaging/easy_install index d54ccfe35f..086ab6d5b4 100644 --- a/library/packaging/easy_install +++ b/library/packaging/easy_install @@ -57,6 +57,16 @@ options: C(pyvenv), C(virtualenv), C(virtualenv2). required: false default: virtualenv + executable: + description: + - The explicit executable or a pathname to the executable to be used to + run easy_install for a specific version of Python installed in the + system. For example C(easy_install-3.3), if there are both Python 2.7 + and 3.3 installations in the system and you want to run easy_install + for the Python 3.3 installation. +version_added: "1.3" + required: false + default: null notes: - Please note that the M(easy_install) module can only install Python libraries. Thus this module is not able to remove libraries. It is @@ -88,12 +98,14 @@ def main(): virtualenv=dict(default=None, required=False), virtualenv_site_packages=dict(default='no', type='bool'), virtualenv_command=dict(default='virtualenv', required=False), + executable=dict(default='easy_install', required=False), ) module = AnsibleModule(argument_spec=arg_spec, supports_check_mode=True) name = module.params['name'] env = module.params['virtualenv'] + easy_install = module.get_bin_path(module.params['executable'], True, ['%s/bin' % env]) site_packages = module.params['virtualenv_site_packages'] virtualenv_command = module.params['virtualenv_command']