91 lines
1.1 KiB
Bash
Executable file
91 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
if [ -z "$1" -o ! -f "$1" ]; then
|
|
echo Need filename
|
|
exit 1
|
|
fi
|
|
|
|
for GROUP in almalinux alpine archlinux centos debian devuan fedora oracle rockylinux opensuse ubuntu voidlinux
|
|
do
|
|
echo "[${GROUP}]"
|
|
grep "${GROUP}" "$1" | while read NAME IP REST
|
|
do
|
|
case "${GROUP}" in
|
|
almalinux|rockylinux)
|
|
echo -e "${NAME}\t\tansible_host=${IP}"
|
|
;;
|
|
*)
|
|
echo "${NAME}"
|
|
;;
|
|
esac
|
|
done
|
|
echo ""
|
|
done
|
|
|
|
|
|
cat <<EOF
|
|
############################################################
|
|
|
|
[apk:children]
|
|
alpine
|
|
|
|
[apt]
|
|
EOF
|
|
|
|
grep "mint" "$1" | while read NAME IP REST
|
|
do
|
|
echo "${NAME}"
|
|
done
|
|
|
|
cat <<EOF
|
|
|
|
[apt:children]
|
|
debian
|
|
devuan
|
|
ubuntu
|
|
|
|
[pacman:children]
|
|
archlinux
|
|
|
|
[yum:children]
|
|
almalinux
|
|
centos
|
|
fedora
|
|
oracle
|
|
rockylinux
|
|
|
|
[xbps:children]
|
|
voidlinux
|
|
|
|
[zypper:children]
|
|
opensuse
|
|
|
|
############################################################
|
|
|
|
[lb]
|
|
tn00-alpine3j
|
|
tn00-alpine3k
|
|
|
|
[lb:vars]
|
|
ansible_ssh_transfer_method=piped
|
|
|
|
[worker]
|
|
tn00-ubu2004a
|
|
tn00-ubu2004b
|
|
tn00-ubu2004c
|
|
tn00-ubu2004d
|
|
|
|
tn00-debian11
|
|
|
|
[db]
|
|
tn00-ubu2004a
|
|
tn00-ubu2004b
|
|
|
|
[webcluster:children]
|
|
lb
|
|
worker
|
|
db
|
|
|
|
EOF
|
|
|