salt.states.win_license#
Install and manage software licenses using Windows Software Licensing Service#
Manage product licenses (Windows OS, Office, etc.) using the Software Licensing Service.
activate_windows:
license.activate:
- product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
ensure_office_licensed:
license.present:
- product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
- activate_key: True
remove_office_key:
license.absent:
- product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
- salt.states.win_license.absent(name, product_key='', all_keys=False)#
Ensure that a product key is uninstalled.
- Parameters:
- Returns:
- A standard Salt state return dict with
name,result, changes, andcommentkeys.
- A standard Salt state return dict with
- Return type:
CLI Example:
remove_office_key: license.absent: - product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX remove_all_licenses: license.absent: - all_keys: True
- salt.states.win_license.absent_kms(name, host=False, port=False, product_key='')#
Ensure KMS host and/or port are removed.
- Parameters:
- Returns:
- A standard Salt state return dict with
name,result, changes, andcommentkeys.
- A standard Salt state return dict with
- Return type:
CLI Example:
clear_global_kms_host: license.absent_kms: - host: True clear_kms_port_for_office: license.absent_kms: - product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX - port: True
- salt.states.win_license.activate(name, product_key='')#
Install and activate a product key.
- Parameters:
- Returns:
- A standard Salt state return dict with
name,result, changes, andcommentkeys.
- A standard Salt state return dict with
- Return type:
CLI Example:
activate_windows: license.activate: - product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX XXXXX-XXXXX-XXXXX-XXXXX-XXXXX: license.activate
- salt.states.win_license.present(name, product_key='', kms_host='', kms_port=0, activate_key=False)#
Ensure that a product key is installed with optional KMS and activation.
- Parameters:
name (str) -- Descriptive state ID.
product_key (str) -- The product key to install. If not specified, defaults to
namefor backwards compatibility.kms_host (str) -- Optional KMS host name or IP address.
kms_port (int) -- Optional KMS port number.
activate_key (bool) -- Whether to activate the product key (default: False).
- Returns:
- A standard Salt state return dict with
name,result, changes, andcommentkeys.
- A standard Salt state return dict with
- Return type:
CLI Example:
install_office_key: license.present: - product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX - kms_host: kms.example.com - kms_port: 1688 - activate_key: True
- salt.states.win_license.present_kms(name, kms_host, kms_port=0, product_key='')#
Ensure KMS host and port are configured.
- Parameters:
- Returns:
- A standard Salt state return dict with
name,result, changes, andcommentkeys.
- A standard Salt state return dict with
- Return type:
CLI Example:
configure_kms_globally: license.present_kms: - kms_host: kms.example.com - kms_port: 1688 configure_kms_for_office: license.present_kms: - kms_host: kms.example.com - kms_port: 1688 - product_key: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX