ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
811 stars 1.49k forks source link

zypper_repository doesn't allow name to be used with .repo url. #4532

Open natedogith1 opened 2 years ago

natedogith1 commented 2 years ago

Summary

For zypper_repository, if you specify a repo that ends with .repo and a name, you get the error message "Incompatible option: 'name'. Do not use name when adding .repo files". The documentation only states that name is "not required when adding repofiles.", and "zypper addrepo" supports specifying a name with a .repo url.

Issue Type

Bug Report

Component Name

zypper_repository

Ansible Version

ansible [core 2.12.3]
  config file = None
  configured module search path = ['/home/nfaulkne/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/nfaulkne/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/nfaulkne/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/nfaulkne/.local/bin/ansible
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
  jinja version = 2.10.1
  libyaml = True

Community.general Version

Collection        Version
----------------- -------
community.general 4.6.0

Configuration

No response

OS / Environment

SLES

Steps to Reproduce

- name: Add Microsoft zypper repository for MDATP for Suse
  zypper_repository:
    autorefresh: true
    name: microsoft-prod
    repo: https://packages.microsoft.com/config/sles/{{ ansible_distribution_major_version }}/prod.repo

Expected Results

I expected the repository to be created with the specified name, like it would when running "zypper addrepo -c -f -n microsoft-prod https://packages.microsoft.com/config/sles/{{ ansible_distribution_major_version }}/prod.repo"

Actual Results

FAILED! => {"changed": false, "msg": "Incompatible option: 'name'. Do not use name when adding .repo files"}

Code of Conduct

ansibullbot commented 2 years ago

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 commented 2 years ago

cc @AnderEnder @alxgu @andytom @commel @dcermak @evrardjp @lrupp @sealor @toabctl click here for bot help

ansibullbot commented 1 year ago

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