Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't deactivate a repository with module zypper_repository #8783

Open
1 task
TobiasZeuch181 opened this issue Aug 20, 2024 · 2 comments
Open
1 task

I can't deactivate a repository with module zypper_repository #8783

TobiasZeuch181 opened this issue Aug 20, 2024 · 2 comments
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@TobiasZeuch181
Copy link

TobiasZeuch181 commented Aug 20, 2024

Summary

When I try to deactivate a repository with the module zypper_repository, then this doesn't work.
When I look at the code, I think this is because the code that was introduced in f0fcb22 where the fields for e.g. repodata['enabled'] are overwritten, if the repo-path is provided.
I tried to use name instead of repo, but that doesn't work because state defaults to present and present required repo to be filled.

Issue Type

Bug Report

Component Name

zypper_repository

Ansible Version

$ ansible --version
ansible [core 2.16.5]
  config file = None
  configured module search path = ['/home/i513463/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/i513463/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/i513463/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/i513463/.local/bin/ansible
  python version = 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None

OS / Environment

WSL (Windows subsystem for linux)

Steps to Reproduce

find a repository that is installed on the VM, e.g. packages-microsoft-com-prod-sle15 on a Azure VM

- name: Disable repository for SAP-cloud
      community.general.zypper_repository:
        repo: "/etc/zypp/repos.d/packages-microsoft-com-prod-sle15"
        enabled: false

Expected Results

I expected the repository to be disabled

Actual Results

The task did not change anything and the repository is still enabled

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants