fix hostname problem

This commit is contained in:
Gilles Mouchet 2024-07-01 16:29:33 +02:00
parent 83c3c1b9b3
commit 9108ca7a91
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ alias sudo='sudo --preserve-env=PATH env' # https://www.petefreitag.com/blog/env
if ! is_scp; then if ! is_scp; then
if [[ "$USER" == "gilles" || "$USER" == "root" ]]; 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_fqdn=$(hostname)
host_short=$(hostname -s) host_short=$(hostname -s)
ip=$(hostname -I) ip=$(hostname -I)

View File

@ -6,4 +6,4 @@
line: '{{ item }}' line: '{{ item }}'
state: present state: present
with_items: with_items:
- '{{ ansible_default_ipv4.address }} {{ ansible_hostname }}.gmotech.net {{ ansible_hostname }}' - '{{ ansible_default_ipv4.address }} {{ ansible_hostname }} {{ ansible_hostname }}.gmotech.net'