Commit 887d276
committed
fix(roles/repo_grafana): only render basic-auth credentials when mirror URL is set
When `lfops__repo_basic_auth_login` is set globally for a host that
uses the Linuxfabrik mirror, but `lfops__repo_mirror_url` is empty
(e.g. when there is no mirror for a particular distribution yet), the
generated `grafana.repo` still contained the `username`/`password`
fields. dnf then sent those Basic-Auth credentials to the public
`https://rpm.grafana.com` server, which rejected them with
`Status code: 403 for https://rpm.grafana.com/repodata/repomd.xml`.
Guard the credentials block on `repo_grafana__mirror_url` also being
set, so credentials only leave the host together with a mirror URL to
send them to.1 parent 99506c1 commit 887d276
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
0 commit comments