From c5e5279f0e083b6ed3ea78b9135d0bf5f6fb8f02 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Mon, 24 Apr 2023 12:10:30 +0200 Subject: [PATCH] Add reference to self --- templates/multinode/get_paying_customers.erb.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/multinode/get_paying_customers.erb.sh b/templates/multinode/get_paying_customers.erb.sh index 2ec2ace..e1458b1 100644 --- a/templates/multinode/get_paying_customers.erb.sh +++ b/templates/multinode/get_paying_customers.erb.sh @@ -1,4 +1,5 @@ #!/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 -E "$(cat /etc/hiera/data/common.yaml | yq -r '.singlenodes[]' | sed -e 's/^- //' -e 's/$/|/' | tr -d '\n' | sed 's/|$//')"