Dynamic Ansible Inventory for eenfach.de LDOMs and Zones
Olaf Bohlen
2020-04-23 17742cfad3ce2e4d0f59f7eb1993792fbcd04da7
simple and dirty approach
1 files modified
9 ■■■■ changed files
eenfach-iv.ksh 9 ●●●● patch | view | raw | blame | history
eenfach-iv.ksh
@@ -2,6 +2,13 @@
# olbohlen, 2020-04-17 in corona seperation...
# for my personal setup build a dynamic inventory of all ldoms and zones
# --list is default action
# fake --host operation by printing an empty dictionary
if [ "x$1" == "x--host" ]; then
    printf "{}\n"
    exit 0
fi
domain=eenfach.de
primary="prigw-vsw"
@@ -34,7 +41,7 @@
# print ldoms group
printf "\"eenfachldoms\": {\n\"hosts\": ["
for ldom in ${ldoms}; do
    printf "%s\n\"%s\"" "${comma}" "${ldom}"
    printf "%s\n\"%s.%s\"" "${comma}" "${ldom}" "${domain}"
    comma=","
done
comma=""