zypper – Manage packages on SUSE and openSUSE
zypper – Manage packages on SUSE and openSUSE
Synopsis
- Manage packages on SUSE and openSUSE using the zypper and rpm tools.
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
- rpm
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
disable_gpg_check boolean |
|
Whether to disable to GPG signature checking of the package signature being installed. Has an effect only if state is present or latest. |
disable_recommends boolean |
|
Corresponds to the |
extra_args - added in 2.4 |
Add additional options to Options should be supplied in a single line as if given in the command line. | |
extra_args_precommand - added in 2.6 |
Add additional global target options to Options should be supplied in a single line as if given in the command line. | |
force boolean added in 2.2 |
|
Adds |
name - / required |
Package name Can include a version like You can also pass a url or a local path to a rpm file. When using state=latest, this can be '*', which updates all installed packages.
| |
oldpackage boolean added in 2.2 |
|
Adds |
state - |
|
When using |
type - added in 2.0 |
|
The type of package to be operated on. |
update_cache boolean added in 2.2 |
|
Run the equivalent of
|
Notes
Note
- When used with a
loop:
each package will be processed individually, it is much more efficient to pass the list directly to thename
option.
Examples
# Install "nmap"
- zypper:
name: nmap
state: present
# Install apache2 with recommended packages
- zypper:
name: apache2
state: present
disable_recommends: no
# Apply a given patch
- zypper:
name: openSUSE-2016-128
state: present
type: patch
# Remove the "nmap" package
- zypper:
name: nmap
state: absent
# Install the nginx rpm from a remote repo
- zypper:
name: 'http://nginx.org/packages/sles/12/x86_64/RPMS/nginx-1.8.0-1.sles12.ngx.x86_64.rpm'
state: present
# Install local rpm file
- zypper:
name: /tmp/fancy-software.rpm
state: present
# Update all packages
- zypper:
name: '*'
state: latest
# Apply all available patches
- zypper:
name: '*'
state: latest
type: patch
# Perform a dist-upgrade with additional arguments
- zypper:
name: '*'
state: dist-upgrade
extra_args: '--no-allow-vendor-change --allow-arch-change'
# Refresh repositories and update package "openssl"
- zypper:
name: openssl
state: present
update_cache: yes
# Install specific version (possible comparisons: <, >, <=, >=, =)
- zypper:
name: 'docker>=1.10'
state: present
# Wait 20 seconds to acquire the lock before failing
- zypper:
name: mosh
state: present
environment:
ZYPP_LOCK_TIMEOUT: 20
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors
- Patrick Callahan (@dirtyharrycallahan)
- Alexander Gubin (@alxgu)
- Thomas O’Donnell (@andytom)
- Robin Roth (@robinro)
- Andrii Radyk (@AnderEnder)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.8/modules/zypper_module.html