0

How to add a new rpm package repo via saltstack?

I checked the docs, and only see method to list, modify or delete repos:

https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.zypper.html

I would like to do this:

root@server# zypper ar https://myserver/my-funny-repo-url.repo

sls file:

zypper_repo:
  pkgrepo.managed:
    - mirrorlist: https://myserver/my-funny-repo-url.repo
    - failhard: True

Error:

CommandExecutionError: Zypper command failure: Repository 'zypper_repo' is invalid.

[zypper_repo|https://myserver/my-funny-repo-url.repo]

Valid metadata not found at specified URL Please check if the URIs defined for this repository are pointing to a valid repository. Skipping repository 'zypper_repo' because of the above error. Some of the repositories have not been refreshed because of an error.

0

Quote from the documentation you linked:

salt.modules.zypper.mod_repo
Modify one or more values for a repo. If the repo does not exist, it will be created, so long as the following values are specified:

  • And how to use this module in a sls-file? – guettli Feb 14 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.