ansible.builtin.zypper_repository (v2.9.27) — module

Add and remove Zypper repositories

| "added in version" 1.4 of ansible.builtin"

Authors: Matthias Vogelgesang (@matze)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Add or remove Zypper repositories on SUSE and openSUSE


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add NVIDIA repository for graphics drivers
- 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.
# Remove NVIDIA repository
- 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.
# Add python development repository
- 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.
# Refresh all repos
- zypper_repository:
    repo: '*'
    runrefresh: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Force refresh of a repository
- zypper_repository:
    repo: 'http://my_internal_ci_repo/repo'
    name: my_ci_repo
    state: present
    runrefresh: yes

Inputs

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

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

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

enabled:
    default: 'yes'
    description:
    - Set repository to enabled (or disabled).
    type: bool
    version_added: '2.2'
    version_added_collection: ansible.builtin

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.
    version_added: '2.1'
    version_added_collection: ansible.builtin

runrefresh:
    default: 'no'
    description:
    - Refresh the package list of the given repository.
    - Can be used with repo=* to refresh all repositories.
    type: bool
    version_added: '2.2'
    version_added_collection: ansible.builtin

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

description:
    description:
    - A description of the repository

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

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

overwrite_multiple:
    default: 'no'
    description:
    - Overwrite multiple repository entries, if repositories with both name and URL already
      exist.
    type: bool
    version_added: '2.1'
    version_added_collection: ansible.builtin