1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Clarify scripts/local_facts.fact

This commit is contained in:
A Holt 2020-10-19 15:29:46 -04:00 committed by GitHub
parent dd40abd738
commit 0a0f38716a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,19 +91,24 @@ tmp=$(cat /proc/device-tree/model) &&
tmp=$(ansible --version) &&
ANSIBLE_VERSION=$(echo $tmp | head -n 1 | cut -f 2 -d " ")
# THESE LAST 3 ARE DIFFEENT as "systemctl is-enabled" unhelpfully returns the
# same rerror code (i.e. 1) REGARDLESS whether service is (A) disabled or
# (B) doesn't exist. SO WE TEST THE STRING OUTPUT INSTEAD OF THE RETURN CODE.
tmp=$(systemctl is-enabled dhcpcd)
[[ $tmp = "" ]] || DHCPCD=$tmp
[[ $tmp != "" ]] &&
DHCPCD=$tmp
#[[ $tmp ]] && DHCPCD=$tmp # Short Ain't Sweet (less understandable)
# Debian family only, as is_redhat would use NetworkManager as the service name
tmp=$(systemctl is-enabled network-manager)
[[ $tmp = "" ]] || NETWORK_MANAGER=$tmp
[[ $tmp != "" ]] &&
NETWORK_MANAGER=$tmp
tmp=$(systemctl is-enabled systemd-networkd)
[[ $tmp = "" ]] || SYSTEMD_NETWORKD=$tmp
[[ $tmp != "" ]] &&
SYSTEMD_NETWORKD=$tmp
cat <<EOF