mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-22 03:43:09 +00:00
fix: remove the need for setting _repo_type variable
Signed-off-by: gardar <gardar@users.noreply.github.com>
This commit is contained in:
parent
62a115f4cf
commit
8f9e86a905
2 changed files with 10 additions and 4 deletions
13
.github/scripts/discover_role_repos.sh
vendored
13
.github/scripts/discover_role_repos.sh
vendored
|
@ -3,9 +3,16 @@
|
|||
# Description: Discover the upstream repo from each role default vars.
|
||||
|
||||
result=$(
|
||||
for defaults_file in roles/*/vars/main.yml ; do
|
||||
role="$(echo "${defaults_file}" | cut -f2 -d'/')"
|
||||
yq eval "[{\"repo\": ._${role}_repo, \"role\": \"${role}\", \"type\": ._${role}_repo_type // \"github\"}]" "${defaults_file}"
|
||||
for role_dir in roles/*/ ; do
|
||||
role="$(basename "${role_dir}")"
|
||||
|
||||
role_repo=$(yq eval "._${role}_repo" "${role_dir}/vars/main.yml" 2>/dev/null)
|
||||
|
||||
yq eval "[{
|
||||
\"repo\": \"${role_repo}\",
|
||||
\"role\": \"${role}\",
|
||||
\"type\": (.${role}_binary_url | split(\"/\")[2] | split(\".\")[0] // \"github\")
|
||||
}]" "${role_dir}/defaults/main.yml" 2>/dev/null
|
||||
done | yq -o json -I=0
|
||||
)
|
||||
|
||||
|
|
|
@ -8,4 +8,3 @@ go_arch_map:
|
|||
|
||||
go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}"
|
||||
_fail2ban_exporter_repo: 24199687
|
||||
_fail2ban_exporter_repo_type: gitlab
|
||||
|
|
Loading…
Reference in a new issue