W3cubDocs

/Ansible

zypper_repository - Add and remove Zypper repositories

New in version 1.4.

Synopsis

  • Add or remove Zypper repositories on SUSE and openSUSE

Requirements (on host that executes module)

  • zypper >= 1.0 # included in openSuSE >= 11.1 or SuSE Linux Enterprise Server/Desktop >= 11.0
  • python-xml

Options

parameter required default choices comments
auto_import_keys
(added in 2.2)
no no
  • yes
  • no
Automatically import the gpg signing key of the new or changed repository.
Has an effect only if state is present. Has no effect on existing (unchanged) repositories or in combination with absent.
Implies runrefresh.
autorefresh
no yes
  • yes
  • no
Enable autorefresh of the repository.
aliases: refresh
description
no none
A description of the repository
disable_gpg_check
no no
  • yes
  • no
Whether to disable GPG signature checking of all packages. Has an effect only if state is present.
Needs zypper version >= 1.6.2.
enabled
(added in 2.2)
no yes
  • yes
  • no
Set repository to enabled (or disabled).
name
no none
A name for the repository. Not required when adding repofiles.
overwrite_multiple
(added in 2.1)
no no
  • yes
  • no
Overwrite multiple repository entries, if repositories with both name and URL already exist.
priority
(added in 2.1)
no
Set priority of repository. Packages will always be installed from the repository with the smallest priority number.
Needs zypper version >= 1.12.25.
repo
no none
URI of the repository or .repo file. Required when state=present.
runrefresh
(added in 2.2)
no no
  • yes
  • no
Refresh the package list of the given repository.
Can be used with repo=* to refresh all repositories.
state
no present
  • absent
  • present
A source string state.

Examples

# Add NVIDIA repository for graphics drivers
- zypper_repository:
    name: nvidia-repo
    repo: 'ftp://download.nvidia.com/opensuse/12.2'
    state: present

# Remove NVIDIA repository
- zypper_repository:
    name: nvidia-repo
    repo: 'ftp://download.nvidia.com/opensuse/12.2'
    state: absent

# Add python development repository
- zypper_repository:
    repo: 'http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo'

# Refresh all repos
- zypper_repository:
    repo: '*'
    runrefresh: yes

# Add a repo and add it's gpg key
- zypper_repository:
    repo: 'http://download.opensuse.org/repositories/systemsmanagement/openSUSE_Leap_42.1/'
    auto_import_keys: yes

# Force refresh of a repository
- zypper_repository:
    repo: 'http://my_internal_ci_repo/repo'
    name: my_ci_repo
    state: present
    runrefresh: yes

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/zypper_repository_module.html