diff --git a/ansible/roles/linux-baseline/templates/motd.j2 b/ansible/roles/linux-baseline/templates/motd.j2 index 6f4fc2d..fc26c02 100644 --- a/ansible/roles/linux-baseline/templates/motd.j2 +++ b/ansible/roles/linux-baseline/templates/motd.j2 @@ -1,11 +1,14 @@ +{% set host_label = baseline_motd_banner ~ ' - ' ~ inventory_hostname %} +{% set os_label = ansible_distribution ~ ' ' ~ ansible_distribution_version ~ ' (' ~ ansible_kernel ~ ')' %} +{% set inner_width = 61 %} ╔═══════════════════════════════════════════════════════════════╗ - ║ ║ - ║ {{ baseline_motd_banner }} - {{ inventory_hostname }}{{ ' ' * (50 - (baseline_motd_banner | length) - (inventory_hostname | length)) }}║ - ║ ║ - ║ {{ ansible_distribution }} {{ ansible_distribution_version }} ({{ ansible_kernel }}){{ ' ' * (53 - (ansible_distribution | length) - (ansible_distribution_version | length) - (ansible_kernel | length)) }}║ - ║ ║ - ║ Managed by Ansible. Local changes will be overwritten. ║ - ║ ║ + ║{{ ' ' * inner_width }}║ + ║ {{ host_label }}{{ ' ' * (inner_width - 3 - host_label | length) }}║ + ║{{ ' ' * inner_width }}║ + ║ {{ os_label }}{{ ' ' * (inner_width - 3 - os_label | length) }}║ + ║{{ ' ' * inner_width }}║ + ║ Managed by Ansible. Local changes will be overwritten. ║ + ║{{ ' ' * inner_width }}║ ╚═══════════════════════════════════════════════════════════════╝