diff --git a/files/os/gmo-cfg.sh b/files/os/gmo-cfg.sh index 38d343c..857b381 100644 --- a/files/os/gmo-cfg.sh +++ b/files/os/gmo-cfg.sh @@ -33,7 +33,7 @@ alias sudo='sudo --preserve-env=PATH env' # https://www.petefreitag.com/blog/env if ! is_scp; then if [[ "$USER" == "gilles" || "$USER" == "root" ]]; then - host_domain=$(hostname -d) + host_domain=$(cat /etc/hostname| rev | cut -d. -f1-2 | rev) host_fqdn=$(hostname) host_short=$(hostname -s) ip=$(hostname -I) diff --git a/hosts.yml b/hosts.yml index 66cbeee..8162200 100644 --- a/hosts.yml +++ b/hosts.yml @@ -6,4 +6,4 @@ line: '{{ item }}' state: present with_items: - - '{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.gmotech.net {{ ansible_hostname }}' \ No newline at end of file + - '{{ ansible_default_ipv4.address }} {{ ansible_hostname }} {{ ansible_hostname }}.gmotech.net' \ No newline at end of file