A dead simple module wrapping calls to the Chocolatey package manager (http://chocolatey.org)
2014.1.0 新版功能.
salt.modules.chocolatey.
add_source
(name, source_location, username=None, password=None)¶Instructs Chocolatey to add a source.
CLI 范例:
salt '*' chocolatey.add_source <source name> <source_location>
salt '*' chocolatey.add_source <source name> <source_location> user=<user> password=<password>
salt.modules.chocolatey.
bootstrap
(force=False)¶Download and install the latest version of the Chocolatey package manager via the official bootstrap.
Chocolatey requires Windows PowerShell and the .NET v4.0 runtime. Depending on the host's version of Windows, chocolatey.bootstrap will attempt to ensure these prerequisites are met by downloading and executing the appropriate installers from Microsoft.
Note that if PowerShell is installed, you may have to restart the host machine for Chocolatey to work.
CLI 范例:
salt '*' chocolatey.bootstrap
salt '*' chocolatey.bootstrap force=True
salt.modules.chocolatey.
chocolatey_version
()¶Returns the version of Chocolatey installed on the minion.
CLI 范例:
salt '*' chocolatey.chocolatey_version
salt.modules.chocolatey.
disable_source
(name)¶Instructs Chocolatey to disable a source.
CLI 范例:
salt '*' chocolatey.disable_source <name>
salt.modules.chocolatey.
enable_source
(name)¶Instructs Chocolatey to enable a source.
CLI 范例:
salt '*' chocolatey.enable_source <name>
salt.modules.chocolatey.
install
(name, version=None, source=None, force=False, pre_versions=False, install_args=None, override_args=False, force_x86=False, package_args=None)¶Instructs Chocolatey to install a package.
CLI 范例:
salt '*' chocolatey.install <package name>
salt '*' chocolatey.install <package name> version=<package version>
salt '*' chocolatey.install <package name> install_args=<args> override_args=True
salt.modules.chocolatey.
install_cygwin
(name, install_args=None, override_args=False)¶Instructs Chocolatey to install a package via Cygwin.
CLI 范例:
salt '*' chocolatey.install_cygwin <package name>
salt '*' chocolatey.install_cygwin <package name> install_args=<args> override_args=True
salt.modules.chocolatey.
install_gem
(name, version=None, install_args=None, override_args=False)¶Instructs Chocolatey to install a package via Ruby's Gems.
CLI 范例:
salt '*' chocolatey.install_gem <package name>
salt '*' chocolatey.install_gem <package name> version=<package version>
salt '*' chocolatey.install_gem <package name> install_args=<args> override_args=True
salt.modules.chocolatey.
install_missing
(name, version=None, source=None)¶Instructs Chocolatey to install a package if it doesn't already exist.
在 2014.7.0 版更改: If the minion has Chocolatey >= 0.9.8.24 installed, this function calls
chocolatey.install
instead, as
installmissing
is deprecated as of that version and will be removed
in Chocolatey 1.0.
CLI 范例:
salt '*' chocolatey.install_missing <package name>
salt '*' chocolatey.install_missing <package name> version=<package version>
salt.modules.chocolatey.
install_python
(name, version=None, install_args=None, override_args=False)¶Instructs Chocolatey to install a package via Python's easy_install.
CLI 范例:
salt '*' chocolatey.install_python <package name>
salt '*' chocolatey.install_python <package name> version=<package version>
salt '*' chocolatey.install_python <package name> install_args=<args> override_args=True
salt.modules.chocolatey.
install_webpi
(name, install_args=None, override_args=False)¶Instructs Chocolatey to install a package via the Microsoft Web PI service.
CLI 范例:
salt '*' chocolatey.install_webpi <package name>
salt '*' chocolatey.install_webpi <package name> install_args=<args> override_args=True
salt.modules.chocolatey.
install_windowsfeatures
(name)¶Instructs Chocolatey to install a Windows Feature via the Deployment Image Servicing and Management tool.
CLI 范例:
salt '*' chocolatey.install_windowsfeatures <package name>
salt.modules.chocolatey.
list
(narrow=None, all_versions=False, pre_versions=False, source=None, local_only=False)¶Instructs Chocolatey to pull a vague package list from the repository.
CLI 范例:
salt '*' chocolatey.list <narrow>
salt '*' chocolatey.list <narrow> all_versions=True
salt.modules.chocolatey.
list_webpi
()¶Instructs Chocolatey to pull a full package list from the Microsoft Web PI repository.
CLI 范例:
salt '*' chocolatey.list_webpi
salt.modules.chocolatey.
list_windowsfeatures
()¶Instructs Chocolatey to pull a full package list from the Windows Features list, via the Deployment Image Servicing and Management tool.
CLI 范例:
salt '*' chocolatey.list_windowsfeatures
salt.modules.chocolatey.
uninstall
(name, version=None, uninstall_args=None, override_args=False)¶Instructs Chocolatey to uninstall a package.
CLI 范例:
salt '*' chocolatey.uninstall <package name>
salt '*' chocolatey.uninstall <package name> version=<package version>
salt '*' chocolatey.uninstall <package name> version=<package version> uninstall_args=<args> override_args=True
salt.modules.chocolatey.
update
(name, source=None, pre_versions=False)¶Instructs Chocolatey to update packages on the system.
CLI 范例:
salt "*" chocolatey.update all
salt "*" chocolatey.update <package name> pre_versions=True
salt.modules.chocolatey.
version
(name, check_remote=False, source=None, pre_versions=False)¶Instructs Chocolatey to check an installed package version, and optionally compare it to one available from a remote feed.
CLI 范例:
salt "*" chocolatey.version <package name>
salt "*" chocolatey.version <package name> check_remote=True