From d85087992518cfab422bb90fcdf3b179c75f7b1d Mon Sep 17 00:00:00 2001 From: Alexis Danjon Date: Wed, 15 Jul 2026 05:14:51 -0400 Subject: [PATCH] =?UTF-8?q?fix(bundles):=20add=20configure/terminfo=20bund?= =?UTF-8?q?le=20=E2=80=94=20install=20alacritty=20terminfo=20on=20remote?= =?UTF-8?q?=20hosts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ubuntu 24.04 minimal images don't ship the alacritty terminfo entry. SSH forwards the local TERM value, so connecting from an Alacritty session triggers "'alacritty': unknown terminal type." on the remote. Adds AcceptEnv TERM to sshd_config and copies /usr/share/terminfo/a/alacritty from the Ansible controller to /etc/terminfo/a/alacritty on each target. Relates to range42/range42#227. --- .../linux/ubuntu/configure/terminfo/main.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 bundles/core/linux/ubuntu/configure/terminfo/main.yml diff --git a/bundles/core/linux/ubuntu/configure/terminfo/main.yml b/bundles/core/linux/ubuntu/configure/terminfo/main.yml new file mode 100644 index 00000000..7811ca35 --- /dev/null +++ b/bundles/core/linux/ubuntu/configure/terminfo/main.yml @@ -0,0 +1,46 @@ +## +## configure/terminfo — install alacritty terminfo on remote hosts +## +## Ubuntu 24.04 minimal images do not ship the alacritty terminfo entry. +## SSH forwards the local TERM value, so connecting from an Alacritty session +## triggers "'alacritty': unknown terminal type." on the remote. +## +## This play copies the alacritty terminfo binary from the Ansible controller +## (where Alacritty is installed) to /etc/terminfo/a/alacritty on each target, +## and configures sshd to accept the TERM environment variable from the client. +## +## Caller: scenarios import this via `import_playbook` in their stage_01, +## overriding `hosts` to the relevant inventory group (e.g. r42_admin_services_lab_group). +## Relates to: range42/range42#227 +## + +- name: configure sshd and alacritty terminfo + hosts: all + become: true + tasks: + - name: allow SSH client to forward TERM environment variable + ansible.builtin.lineinfile: + path: /etc/ssh/sshd_config + regexp: '^AcceptEnv TERM' + insertafter: '^AcceptEnv LANG LC_\*' + line: 'AcceptEnv TERM' + notify: reload sshd + + - name: ensure /etc/terminfo/a directory exists + ansible.builtin.file: + path: /etc/terminfo/a + state: directory + mode: '0755' + + - name: install alacritty terminfo so TERM=alacritty works over SSH + ansible.builtin.copy: + src: /usr/share/terminfo/a/alacritty + dest: /etc/terminfo/a/alacritty + mode: '0644' + ignore_errors: true + + handlers: + - name: reload sshd + ansible.builtin.service: + name: ssh + state: reloaded