blse2-public/common-debian/templates/etc/ansible/facts.d/host_id.fact.j2

9 lines
175 B
Plaintext
Raw Normal View History

2023-05-05 15:47:27 -04:00
#!/bin/bash
# Ansible fact - host_id
# {{ ansible_managed }}
HOST_ID="$( hostname -s | grep -o '[0-9]\+' )"
if [[ -z ${HOST_ID} ]]; then
HOST_ID="0"
fi
echo "\"${HOST_ID}\""