Saltstack module gem 详解

gem.sources_list

List the configured gem sources.

:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.sources_list

gem.sources_remove

Remove a gem source.

:param source_uri: string
The source URI to remove.
:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.sources_remove http://rubygems.org/

gem.update

Update one or several gems.

:param gems: string
The gems to update.
:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.update vagrant

gem.install

Installs one or several gems.

:param gems: string
The gems to install
:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.
:param version: string : None
Specify the version to install for the gem.
Doesn't play nice with multiple gems at once
:param rdoc: boolean : False
Generate RDoc documentation for the gem(s).
For rubygems > 3 this is interpreted as the --no-document arg and the
ri option will then be ignored
:param ri: boolean : False
Generate RI documentation for the gem(s).
For rubygems > 3 this is interpreted as the --no-document arg and the
rdoc option will then be ignored
:param pre_releases: boolean : False
Include pre-releases in the available versions
:param proxy: string : None
Use the specified HTTP proxy server for all outgoing traffic.
Format: http://hostname[:port]

source : None
Use the specified HTTP gem source server to download gem.
Format: http://hostname[:port]

CLI Example:

salt '*' gem.install vagrant

salt '*' gem.install redphone gem_bin=/opt/sensu/embedded/bin/gem

gem.sources_add

Add a gem source.

:param source_uri: string
The source URI to add.
:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.sources_add http://rubygems.org/

gem.list

List locally installed gems.

:param prefix: string :
Only list gems when the name matches this prefix.
:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.list

gem.uninstall

Uninstall one or several gems.

:param gems: string
The gems to uninstall.
:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.uninstall vagrant

gem.list_upgrades

New in version 2015.8.0

Check if an upgrade is available for installed gems

gem_bin : None
Full path to gem binary to use.
ruby : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
runas : None
The user to run gem as.

CLI Example:

salt '*' gem.list_upgrades

gem.update_system

Update rubygems.

:param version: string : (newest)
The version of rubygems to install.
:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.update_system

gem.version

Print out the version of gem

:param gem_bin: string : None
Full path to gem binary to use.
:param ruby: string : None
If RVM or rbenv are installed, the ruby version and gemset to use.
Ignored if gem_bin is specified.
:param runas: string : None
The user to run gem as.

CLI Example:

salt '*' gem.version

posted @ 2020-03-28 21:00  random_lee  阅读(125)  评论(0)    收藏  举报