Files
ansible/files/home/hpf-ans/bin/get-hpf-facts.sh
T
2026-08-01 13:49:29 -05:00

40 lines
643 B
Bash

#!/usr/bin/env sh
if [ -z "${1:-}" ] ; then
echo "ERROR - ansible OS family unspecified." >&2
exit 1
fi
ANSIBLE_OS_FAMILY="${1}"
shift
if [ "${#}" -ne 0 ] ; then
echo "ERROR - unknown command line parameter specified." >&2
exit 2
fi
useradd_D() {
case "${ANSIBLE_OS_FAMILY}" in
Debian)
/usr/sbin/useradd -D
;;
RedHat)
/usr/sbin/useradd -D
;;
*)
echo "ERROR - Unknown ansible OS FAMILY \"${ANSIBLE_OS_FAMILY}\"." >&2
exit 99
;;
esac
}
user_vars() {
useradd_D | sed 's/.*=/\L&/'
}
(
user_vars
) | jo