From 1c5cb83ff30154bc7f026265f43f18778c6f72fe Mon Sep 17 00:00:00 2001 From: Demian Gemperli Date: Wed, 18 Mar 2015 19:10:54 +0100 Subject: [PATCH] Allow to add build flags for gem installation --- lib/ansible/modules/packaging/language/gem.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/language/gem.py b/lib/ansible/modules/packaging/language/gem.py index 3740a3e7ce3..54d06da7466 100644 --- a/lib/ansible/modules/packaging/language/gem.py +++ b/lib/ansible/modules/packaging/language/gem.py @@ -73,6 +73,11 @@ options: required: false default: "no" version_added: "1.6" + build_flags: + description: + - Allow adding build flags for gem compilation + required: false + version_added: "2.0" author: Johan Wiren ''' @@ -185,6 +190,8 @@ def install(module): cmd.append('--no-rdoc') cmd.append('--no-ri') cmd.append(module.params['gem_source']) + if module.params['build_flags']: + cmd.extend([ '--', module.params['build_flags'] ]) module.run_command(cmd, check_rc=True) def main(): @@ -198,8 +205,9 @@ def main(): repository = dict(required=False, aliases=['source'], type='str'), state = dict(required=False, default='present', choices=['present','absent','latest'], type='str'), user_install = dict(required=False, default=True, type='bool'), - pre_release = dict(required=False, default=False, type='bool'), + pre_release = dict(required=False, default=False, type='bool'), version = dict(required=False, type='str'), + build_flags = dict(required=False, type='str'), ), supports_check_mode = True, mutually_exclusive = [ ['gem_source','repository'], ['gem_source','version'] ],