This commit is contained in:
Micke Nordin 2025-05-23 12:22:17 +02:00
parent 4a1d8140b0
commit dc4ed866f3

View file

@ -13,10 +13,10 @@ else
allowmixedcustomers=no allowmixedcustomers=no
fi fi
yaml="/etc/hiera/data/common.yaml" yaml="/etc/hiera/data/common.yaml"
remotes=( $(yq -r ".project_mapping.${customer}.<% @=environment %>.primary_project" ${yaml})) remotes=( $(yq -r ".project_mapping.${customer}.<%= @environment %>.primary_project" ${yaml}))
remotes+=($(yq -r ".project_mapping.${customer}.<% @=environment %>.mirror_project" ${yaml})) remotes+=($(yq -r ".project_mapping.${customer}.<%= @environment %>.mirror_project" ${yaml}))
remotes+=($(yq -r ".project_mapping.${customer}.<% @=environment %>.assigned | .[].project" ${yaml})) remotes+=($(yq -r ".project_mapping.${customer}.<%= @environment %>.assigned | .[].project" ${yaml}))
remotes+=($(yq -r ".project_mapping.${customer}.<% @=environment %>.assigned | .[].mirror_project" ${yaml})) remotes+=($(yq -r ".project_mapping.${customer}.<%= @environment %>.assigned | .[].mirror_project" ${yaml}))
userjson=$(rclone cat --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "statistics:drive-server-coms/${location}/users.json") userjson=$(rclone cat --no-check-certificate --webdav-headers "Host,sunet.drive.sunet.se" --use-cookies "statistics:drive-server-coms/${location}/users.json")
users=$(echo ${userjson} | jq -r '.| keys | .[] | test("^((?!(^admin|^[_])).)*$")' | grep true | wc -l) users=$(echo ${userjson} | jq -r '.| keys | .[] | test("^((?!(^admin|^[_])).)*$")' | grep true | wc -l)
outfile1="${customer}-${date}-detailed.csv" outfile1="${customer}-${date}-detailed.csv"