salt.modules.gem

Manage ruby gems.

salt.modules.gem.install(gems, ruby=None, gem_bin=None, runas=None, version=None, rdoc=False, ri=False, pre_releases=False, proxy=None, source=None)

Installs one or several gems.

参数:
  • gems -- string The gems to install
  • gem_bin -- string : None Full path to gem binary to use.
  • ruby -- string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if gem_bin is specified.
  • runas -- string : None The user to run gem as.
  • version -- string : None Specify the version to install for the gem. Doesn't play nice with multiple gems at once
  • rdoc -- boolean : False Generate RDoc documentation for the gem(s).
  • ri -- boolean : False Generate RI documentation for the gem(s).
  • pre_releases -- boolean : False Include pre-releases in the available versions
  • 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 范例:

salt '*' gem.install vagrant

salt '*' gem.install redphone gem_bin=/opt/sensu/embedded/bin/gem
salt.modules.gem.list(prefix='', ruby=None, runas=None, gem_bin=None)

List locally installed gems.

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

CLI 范例:

salt '*' gem.list
salt.modules.gem.list_upgrades(ruby=None, runas=None, gem_bin=None)

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 范例:

salt '*' gem.list_upgrades
salt.modules.gem.sources_add(source_uri, ruby=None, runas=None, gem_bin=None)

Add a gem source.

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

CLI 范例:

salt '*' gem.sources_add http://rubygems.org/
salt.modules.gem.sources_list(ruby=None, runas=None, gem_bin=None)

List the configured gem sources.

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

CLI 范例:

salt '*' gem.sources_list
salt.modules.gem.sources_remove(source_uri, ruby=None, runas=None, gem_bin=None)

Remove a gem source.

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

CLI 范例:

salt '*' gem.sources_remove http://rubygems.org/
salt.modules.gem.uninstall(gems, ruby=None, runas=None, gem_bin=None)

Uninstall one or several gems.

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

CLI 范例:

salt '*' gem.uninstall vagrant
salt.modules.gem.update(gems, ruby=None, runas=None, gem_bin=None)

Update one or several gems.

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

CLI 范例:

salt '*' gem.update vagrant
salt.modules.gem.update_system(version='', ruby=None, runas=None, gem_bin=None)

Update rubygems.

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

CLI 范例:

salt '*' gem.update_system