Update deploy-tws-motd

This commit is contained in:
2026-01-19 20:51:18 -05:00
parent 3f17822ca6
commit bbfd9381f9

View File

@@ -1,5 +1,5 @@
--- ---
- name: Deploy TWS MOTD - name: Deploy TWS MOTD (authoritative)
hosts: all hosts: all
become: true become: true
@@ -8,7 +8,11 @@
tws_short: "TWS" tws_short: "TWS"
tasks: tasks:
- name: Remove static MOTD file (Debian default) # ----------------------------
# MOTD PIPELINE SANITIZATION
# ----------------------------
- name: Remove static Debian MOTD
file: file:
path: /etc/motd path: /etc/motd
state: absent state: absent
@@ -19,20 +23,42 @@
dest: /etc/motd dest: /etc/motd
state: link state: link
- name: Check for default Ubuntu MOTD scripts - name: Disable Proxmox profile banner
stat:
path: "/etc/update-motd.d/{{ item }}"
loop:
- 10-help-text
- 50-motd-news
register: motd_scripts
- name: Disable default Ubuntu MOTD noise
file: file:
path: "{{ item.stat.path }}" path: /etc/profile.d/pve.sh
state: absent
ignore_errors: true
# Debian runs pam_motd twice — we disable the login path
- name: Disable pam_motd in login (prevents duplicate MOTD)
replace:
path: /etc/pam.d/login
regexp: '^(session\s+optional\s+pam_motd.so.*)$'
replace: '# \1'
ignore_errors: true
# ----------------------------
# DISABLE DEFAULT MOTD SCRIPTS
# ----------------------------
- name: Find default MOTD scripts
find:
paths: /etc/update-motd.d
file_type: file
patterns:
- "10-help-text"
- "50-motd-news"
register: motd_noise
- name: Disable default MOTD noise
file:
path: "{{ item.path }}"
mode: "0644" mode: "0644"
loop: "{{ motd_scripts.results }}" loop: "{{ motd_noise.files }}"
when: item.stat.exists
# ----------------------------
# DEPLOY TWS MOTD
# ----------------------------
- name: Deploy TWS MOTD script - name: Deploy TWS MOTD script
copy: copy:
@@ -43,7 +69,6 @@
ORG="{{ tws_org }}" ORG="{{ tws_org }}"
SHORT="{{ tws_short }}" SHORT="{{ tws_short }}"
WIDTH=58 WIDTH=58
line() { line() {