zypper – Manage packages on SUSE and openSUSE¶
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
- When used with a loop: each package will be processed individually, it is much more efficient to pass the list directly to the name option.
# 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