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.

guettli
  • 3,113
  • 14
  • 59
  • 110

1 Answers1

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:

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79