diff --git a/defaults/main.yml b/defaults/main.yml index b274db9..8511d9a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,3 @@ --- ssh_authorized_keys: [] ssh_authorized_keys_extra: [] - -watchdog_reboot_timer: 16 -watchdog_reset_timer: 10 diff --git a/tasks/main.yml b/tasks/main.yml index e854ffc..287485b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,9 +20,10 @@ line: "{{ item.ip }} {{ item.hosts }}" with_items: - ip: "127.0.0.1" - hosts: "{{ inventory_hostname }} {{ inventory_hostname.split('.')[0] }} localhost localhost.localdomain" + hosts: "{{ inventory_hostname }}.{{ mydomain }} {{ inventory_hostname }} localhost localhost.localdomain" - ip: "::1" - hosts: "{{ inventory_hostname }} {{ inventory_hostname.split('.')[0] }} localhost localhost.localdomain" + hosts: "{{ inventory_hostname }}.{{ mydomain }} {{ inventory_hostname }} localhost localhost.localdomain" + when: mydomain is defined - import_tasks: "pkg_Alpine.yml" when: ansible_distribution == 'Alpine' diff --git a/templates/hostname.j2 b/templates/hostname.j2 index c2786e3..1ee9db5 100644 --- a/templates/hostname.j2 +++ b/templates/hostname.j2 @@ -1 +1 @@ -{{ inventory_hostname.split(".")[0] }} \ No newline at end of file +{{ inventory_hostname }} \ No newline at end of file diff --git a/templates/watchdog-deb.conf.j2 b/templates/watchdog-deb.conf.j2 index 693eb64..e893590 100644 --- a/templates/watchdog-deb.conf.j2 +++ b/templates/watchdog-deb.conf.j2 @@ -29,7 +29,7 @@ #repair-maximum = 1 watchdog-device = /dev/watchdog -watchdog-timeout = {{ watchdog_reboot_timer }} +watchdog-timeout = 16 # Defaults compiled into the binary #temperature-sensor = diff --git a/templates/watchdog.conf.j2 b/templates/watchdog.conf.j2 index 8a5c8c6..0f896a5 100644 --- a/templates/watchdog.conf.j2 +++ b/templates/watchdog.conf.j2 @@ -1,2 +1,2 @@ -WATCHDOG_OPTS="-T {{ watchdog_reboot_timer }} -t {{ watchdog_reset_timer }}" +WATCHDOG_OPTS="-T 16 -t 10" WATCHDOG_DEV="/dev/watchdog"