canonical / canonical/cloud-init

[enhancement]: allow overwriting yum repo

Open
#6,285 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Enhancement

Right now, if you define a yum repo it will skip it when:

- the `canon_repo_id` already exists
- the `.repo` file already exists

There is no method to override anything in the repos that are already present. In my use case I want to comment out `mirrorlist` and insert `baseurl`.

An alternative is to create a copy of an existing repo, change the name a bit (the `canon_repo_id`) and change the necessary properties. However, that still leaves me with the original repo enabled. I can't disable the original repo. Except by adding `runcmd` entries with commands like:
```yaml
runcmd:
- dnf config-manager setopt fedora.enabled=0
```

Perhaps we can add something like this
```yaml
#cloud-init
yum_repos_allow_overwrite:
# List of repos allowed to overwrite
- fedora
- updates
```
and/or
```yaml
#cloud-init
yum_disable_repos:
# List of repos to disable
- fedora
- updates
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.