salt.modules.mac_softwareupdate module

Support for the softwareupdate command on MacOS.

salt.modules.mac_softwareupdate.download(*updates)

Download a named update so that it can be installed later with the install or upgrade function. It returns a list of all updates that are now downloaded.

参数:updates -- The single or list of updates to download.
Ptype:str list
返回:A list of downloaded updates.
返回类型:list

CLI Example:

salt '*' softwareupdate.download <update name>
salt '*' softwareupdate.download "<update with whitespace>"
salt '*' softwareupdate.download <update1> <update2> <update3>
salt.modules.mac_softwareupdate.download_all(rec=False, restart=True)

Download all available updates so that they can be installed later with the install or upgrade function. It returns a list of updates that are now downloaded.

参数:rec (bool) -- If set to True, only install the recommended updates. If

set to False (default) all updates are installed.

参数:restart (bool) -- Set this to False if you do not want to install updates

that require a restart. Default is True

返回:A list containing all downloaded updates on the systesm.
返回类型:list

CLI Example:

salt '*' softwareupdate.download_all
salt.modules.mac_softwareupdate.get_catalog()

2016.3.0 新版功能.

Get the current catalog being used for update lookups. Will return a url if a custom catalog has been specified. Otherwise the word 'Default' will be returned

返回:The catalog being used for update lookups
返回类型:str

CLI Example:

salt '*' softwareupdates.get_catalog
salt.modules.mac_softwareupdate.ignore(*updates)

Ignore a specific program update. When an update is ignored the '-' and version number at the end will be omitted, so "SecUpd2014-001-1.0" becomes "SecUpd2014-001". It will be removed automatically if present. An update is successfully ignored when it no longer shows up after list_upgrades.

参数:updates -- The single or list of updates to add to the ignore list.
Ptype:str list
返回:The list of ignored updates
返回类型:list

CLI Example:

salt '*' softwareupdate.ignore <update-name>
salt '*' softwareupdate.ignore "<update with whitespace>"
salt '*' softwareupdate.ignore <update1> <update2> <update3>
salt.modules.mac_softwareupdate.install(*updates)

Install a named upgrade. Returns a dictionary containing the name of the update and the status of its installation.

参数:updates -- The single or list of updates to install.
Ptype:str list
返回:A dictionary containing the name of the update and the status of

its installation. :rtype: dict - True: The update was installed. - False: The update was not installed. - None: There is no update available with that name.

CLI Example:

salt '*' softwareupdate.install <update-name>
salt '*' softwareupdate.install "<update with whitespace>"
salt '*' softwareupdate.install <update1> <update2> <update3>
salt.modules.mac_softwareupdate.list_downloads()

Return a list of all updates that have been downloaded locally.

返回:A list of updates that have been downloaded
返回类型:list

CLI Example:

salt '*' softwareupdate.list_downloads
salt.modules.mac_softwareupdate.list_ignored()

List all upgrades that has been ignored. Ignored updates are shown without the '-' and version number at the end, this is how the softwareupdate command works.

返回:The list of ignored updates. None if the list is empty
返回类型:list

CLI Example:

salt '*' softwareupdate.list_ignored
salt.modules.mac_softwareupdate.list_upgrades(rec=False, restart=False)

List all available updates.

参数:
  • rec (bool) -- Show only recommended updates.
  • restart (bool) -- Show only updatest that require a restart.
返回:

Returns a dictionary containing the updates

返回类型:

dict

CLI Example:

salt '*' softwareupdate.list_upgrades
salt.modules.mac_softwareupdate.reset_catalog()

2016.3.0 新版功能.

Reset the Software Update Catalog to the default.

返回:True if successful, False if not
返回类型:bool

CLI Example:

salt '*' softwareupdates.reset_catalog
salt.modules.mac_softwareupdate.reset_ignored()

Make sure the ignored updates are not ignored anymore, returns a list of the updates that are no longer ignored.

返回:The list of updates that were removed from the ignore list.
返回类型:list

CLI Example:

salt '*' softwareupdate.reset_ignored
salt.modules.mac_softwareupdate.schedule(*status)

Decide if automatic checking for upgrades should be on or off. If no arguments are given it will return the current status. Append on or off to change the status.

参数:status (bool) -- True to turn on automatic updates. False to turn off

automatic updates. If this value is empty, the current status will be returned.

返回:A value representing the automatic update status
返回类型:bool
  • True: Automatic checking is now on,
  • False: Automatic checking is now off,
  • None: Invalid argument.

CLI Example:

salt '*' softwareupdate.schedule
salt '*' softwareupdate.schedule on|off
salt.modules.mac_softwareupdate.set_catalog(url)

2016.3.0 新版功能.

Set the Software Update Catalog to the URL specified

参数:url (str) -- The url to the update catalog
返回:True if successfult, False if not
返回类型:bool

CLI Example:

salt '*' softwareupdates.set_catalog http://swupd.local:8888/index.sucatalog
salt.modules.mac_softwareupdate.upgrade(rec=False, restart=True)

Install all available upgrades. Returns a dictionary containing the name of the update and the status of its installation.

参数:rec (bool) -- If set to True, only install the recommended updates. If

set to False (default) all updates are installed.

参数:restart (bool) -- Set this to False if you do not want to install updates

that require a restart. Default is True

返回:A dictionary containing the updates that were installed and the

status of its installation. Returns None if no updates were installed. :rtype: dict - True: The update was installed. - False: The update was not installed.

CLI Example:

salt '*' softwareupdate.upgrade
salt.modules.mac_softwareupdate.upgrade_available(update)

Check whether or not an upgrade is available with a given name.

参数:update (str) -- The name of the update to look for
返回:True if available, False if not
返回类型:bool

CLI Example:

salt '*' softwareupdate.upgrade_available <update-name>
salt '*' softwareupdate.upgrade_available "<update with whitespace>"