sunetdrive/templates/multinode/get_non_paying_customers.erb.sh

5 lines
316 B
Bash
Raw Permalink Normal View History

2023-04-24 08:47:36 +00:00
#!/bin/bash
me=$(hostname -s)
cat /etc/hiera/data/common.yaml | yq -r '.multinode_mapping| to_entries |map({name: .key} + .value)| map(select(.server == "'"${me}"'")) |.[] |.name' | \
grep -Ev "$(cat /etc/hiera/data/common.yaml | yq -r '.singlenodes[]' | sed -e 's/^- //' -e 's/$/|/' | tr -d '\n' | sed 's/|$//')"