Skip to content

Commit

Permalink
Gem: Support force flag when uninstalling (#5822)
Browse files Browse the repository at this point in the history
* Gem: Support force flag when uninstalling

* Improve docs' syntax

* Add changelog fragment
  • Loading branch information
juan-vg authored Jan 24, 2023
1 parent f38bfad commit fe520a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/5822-gem-uninstall-force.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- gem - fix force parameter not being passed to gem command when uninstalling (https://github.com/ansible-collections/community.general/pull/5822).
4 changes: 3 additions & 1 deletion plugins/modules/gem.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
required: false
force:
description:
- Force gem to install, bypassing dependency checks.
- Force gem to (un-)install, bypassing dependency checks.
required: false
default: false
type: bool
Expand Down Expand Up @@ -235,6 +235,8 @@ def uninstall(module):
else:
cmd.append('--all')
cmd.append('--executable')
if module.params['force']:
cmd.append('--force')
cmd.append(module.params['name'])
module.run_command(cmd, environ_update=environ, check_rc=True)

Expand Down

0 comments on commit fe520a6

Please sign in to comment.