community.general.zypper – Manage packages on SUSE and openSUSE¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.zypper
.
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¶
Notes¶
Note
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.
Examples¶
- name: Install nmap
community.general.zypper:
name: nmap
state: present
- name: Install apache2 with recommended packages
community.general.zypper:
name: apache2
state: present
disable_recommends: no
- name: Apply a given patch
community.general.zypper:
name: openSUSE-2016-128
state: present
type: patch
- name: Remove the nmap package
community.general.zypper:
name: nmap
state: absent
- name: Install the nginx rpm from a remote repo
community.general.zypper:
name: 'http://nginx.org/packages/sles/12/x86_64/RPMS/nginx-1.8.0-1.sles12.ngx.x86_64.rpm'
state: present
- name: Install local rpm file
community.general.zypper:
name: /tmp/fancy-software.rpm
state: present
- name: Update all packages
community.general.zypper:
name: '*'
state: latest
- name: Apply all available patches
community.general.zypper:
name: '*'
state: latest
type: patch
- name: Perform a dist-upgrade with additional arguments
community.general.zypper:
name: '*'
state: dist-upgrade
allow_vendor_change: true
extra_args: '--allow-arch-change'
- name: Perform a installaion of nmap with the install option replacefiles
community.general.zypper:
name: 'nmap'
state: latest
replacefiles: true
- name: Refresh repositories and update package openssl
community.general.zypper:
name: openssl
state: present
update_cache: yes
- name: "Install specific version (possible comparisons: <, >, <=, >=, =)"
community.general.zypper:
name: 'docker>=1.10'
state: present
- name: Wait 20 seconds to acquire the lock before failing
community.general.zypper:
name: mosh
state: present
environment:
ZYPP_LOCK_TIMEOUT: 20
Authors¶
Patrick Callahan (@dirtyharrycallahan)
Alexander Gubin (@alxgu)
Thomas O’Donnell (@andytom)
Robin Roth (@robinro)
Andrii Radyk (@AnderEnder)