community.general.zypper_repository (8.5.0) — module

Add and remove Zypper repositories

Authors: Matthias Vogelgesang (@matze)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Add or remove Zypper repositories on SUSE and openSUSE


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add NVIDIA repository for graphics drivers
  community.general.zypper_repository:
    name: nvidia-repo
    repo: 'ftp://download.nvidia.com/opensuse/12.2'
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove NVIDIA repository
  community.general.zypper_repository:
    name: nvidia-repo
    repo: 'ftp://download.nvidia.com/opensuse/12.2'
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add python development repository
  community.general.zypper_repository:
    repo: 'http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Refresh all repos
  community.general.zypper_repository:
    repo: '*'
    runrefresh: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a repo and add its gpg key
  community.general.zypper_repository:
    repo: 'http://download.opensuse.org/repositories/systemsmanagement/openSUSE_Leap_42.1/'
    auto_import_keys: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Force refresh of a repository
  community.general.zypper_repository:
    repo: 'http://my_internal_ci_repo/repo'
    name: my_ci_repo
    state: present
    runrefresh: true

Inputs

    
name:
    description:
    - A name for the repository. Not required when adding repofiles.
    type: str

repo:
    description:
    - URI of the repository or .repo file. Required when state=present.
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - A source string state.
    type: str

enabled:
    default: true
    description:
    - Set repository to enabled (or disabled).
    type: bool

priority:
    description:
    - Set priority of repository. Packages will always be installed from the repository
      with the smallest priority number.
    - Needs zypper version >= 1.12.25.
    type: int

runrefresh:
    default: false
    description:
    - Refresh the package list of the given repository.
    - Can be used with repo=* to refresh all repositories.
    type: bool

autorefresh:
    aliases:
    - refresh
    default: true
    description:
    - Enable autorefresh of the repository.
    type: bool

description:
    description:
    - A description of the repository
    type: str

auto_import_keys:
    default: false
    description:
    - Automatically import the gpg signing key of the new or changed repository.
    - Has an effect only if O(state=present). Has no effect on existing (unchanged) repositories
      or in combination with O(state=absent).
    - Implies runrefresh.
    - Only works with C(.repo) files if `name` is given explicitly.
    type: bool

disable_gpg_check:
    default: false
    description:
    - Whether to disable GPG signature checking of all packages. Has an effect only if
      O(state=present).
    - Needs zypper version >= 1.6.2.
    type: bool

overwrite_multiple:
    default: false
    description:
    - Overwrite multiple repository entries, if repositories with both name and URL already
      exist.
    type: bool