community.general.gem module – Manage Ruby gems
Note
This module is part of the community.general collection (version 8.6.8).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.gem
.
Synopsis
Manage installation and uninstallation of Ruby gems.
Aliases: packaging.language.gem
Parameters
Parameter |
Comments |
---|---|
Install executables into a specific directory. |
|
Allow adding build flags for gem compilation |
|
Rewrite the shebang line on installed scripts to use /usr/bin/env. Choices:
|
|
Override the path to the gem executable |
|
Force gem to (un-)install, bypassing dependency checks. Choices:
|
|
The path to a local gem used as installation source. |
|
Whether to include dependencies or not. Choices:
|
|
Install with or without docs. Choices:
|
|
Install the gems into a specific directory. These gems will be independent from the global installed ones. Specifying this requires user_install to be false. |
|
The name of the gem to be managed. |
|
Avoid loading any The default changed from Choices:
|
|
Allow installation of pre-release versions of the gem. Choices:
|
|
The repository from which the gem will be installed |
|
The desired state of the gem. Choices:
|
|
Install gem in user’s local gems cache or for all users Choices:
|
|
Version of the gem to be installed/removed. |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Install version 1.0 of vagrant
community.general.gem:
name: vagrant
version: 1.0
state: present
- name: Install latest available version of rake
community.general.gem:
name: rake
state: latest
- name: Install rake version 1.0 from a local gem on disk
community.general.gem:
name: rake
gem_source: /path/to/gems/rake-1.0.gem
state: present