Adds tmux to the ubuntu_lxc and ubuntu_vm profiles and an opt-in
/etc/profile.d snippet that attaches an interactive SSH login to a tmux
session, created with configurable windows when it does not exist.
- system_baseline_tmux_autostart (default false), _session (default main)
and _windows ([{name, command}]); only ubuntu_lxc and ubuntu_vm install
the snippet, pve never does, and false removes it.
- profile.d is read only by an interactive login shell, so scp, sftp,
ssh host command and automation are unaffected. ~/.no-tmux opts a user
out. ForceCommand is not used: it would affect every session type.
- Names and commands are validated and shell-quoted; the script is
root-owned. Commands run as the logging-in user and are world-readable,
so they must hold no secret.
- Molecule converge enables it, verify checks ownership, mode, the attach
line, the quoting and sh -n.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q72rsMEKREGMfB9DH3T9mR
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
---
|
|
- name: Validate inputs
|
|
ansible.builtin.import_tasks: validate.yml
|
|
tags: always
|
|
|
|
- name: Update & Upgrade Dist
|
|
ansible.builtin.import_tasks: update.yml
|
|
tags: update
|
|
|
|
- name: Manage packages
|
|
ansible.builtin.import_tasks: packages.yml
|
|
tags: packages
|
|
|
|
- name: Configure unattended-upgrades
|
|
ansible.builtin.import_tasks: unattended_upgrades.yml
|
|
when: "'unattended-upgrades' in system_baseline_essential_packages"
|
|
tags: unattended-upgrades
|
|
|
|
- name: Set locale
|
|
ansible.builtin.import_tasks: locale.yml
|
|
tags: locale
|
|
|
|
- name: Set timezone
|
|
ansible.builtin.import_tasks: timezone.yml
|
|
tags: timezone
|
|
|
|
- name: Cap the journal size
|
|
ansible.builtin.import_tasks: journald.yml
|
|
tags: journald
|
|
|
|
- name: Harden sysctl
|
|
ansible.builtin.import_tasks: sysctl.yml
|
|
tags: sysctl
|
|
|
|
- name: Secure temporary filesystems
|
|
ansible.builtin.import_tasks: secure_tmp.yml
|
|
tags: secure_tmp
|
|
|
|
- name: Start tmux on SSH login
|
|
ansible.builtin.import_tasks: tmux.yml
|
|
tags: tmux
|
|
|
|
- name: Reboot if required
|
|
ansible.builtin.import_tasks: reboot.yml
|
|
tags: update
|
|
|
|
- name: Flush handlers early
|
|
ansible.builtin.meta: flush_handlers
|