community.general.zypper_updates_info module – List available Zypper updates
Note
This module is part of the community.general collection (version 14.0.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.zypper_updates_info.
New in community.general 14.0.0
Synopsis
List the updates that
zypper list-updatesreports on SUSE and openSUSE.
Requirements
The below requirements are needed on the host that executes this module.
zypper >= 1.0 (included in openSUSE >= 11.1 or SUSE Linux Enterprise Server/Desktop >= 11.0)
python-xml
Parameters
Parameter |
Comments |
|---|---|
Also list updates that cannot be installed because of dependency problems or locks. Choices:
|
|
The kind of updates to list. Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Returns details on what has changed (or possibly needs changing in |
Notes
Note
Repositories with autorefresh enabled are refreshed when their metadata is outdated. To refresh all repositories first, use community.general.zypper with
update_cache=true.For the installed packages, use ansible.builtin.package_facts.
Examples
- name: List package updates
community.general.zypper_updates_info:
register: result
- name: List needed patches
community.general.zypper_updates_info:
type: patch
register: patches
- name: Fail when a security patch is needed
ansible.builtin.assert:
that: patches.updates | selectattr('category', 'equalto', 'security') | list | length == 0
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The available updates, as reported by Returned: always |
|
The architecture of the update. Returned: always Sample: |
|
The category of the patch, as set by the repository. Commonly used values are Returned: when Sample: |
|
The version of the update. Returned: always Sample: |
|
The installed version. Returned: when it differs from Sample: |
|
The issues the patch fixes. Returned: when Sample: |
|
The identifier of the issue. Returned: always Sample: |
|
The kind of the issue, as set by the repository, for example Returned: always Sample: |
|
The name of the package or patch. Returned: always Sample: |
|
The alias of the repository providing the update. Returned: when zypper reports it Sample: |
|
The severity of the patch, as set by the repository. Commonly used values are Returned: when Sample: |
|
The status of the patch. Without Returned: when Can only return:
Sample: |
|
The summary of the package or patch. Returned: always Sample: |
|
The kind of the update, as selected with Returned: always Can only return:
Sample: |