@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Deploy TWS MOTD (authoritative)
|
- name: Deploy TWS MOTD
|
||||||
hosts: all
|
hosts: all
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
@@ -8,11 +8,7 @@
|
|||||||
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
|
||||||
@@ -23,42 +19,20 @@
|
|||||||
dest: /etc/motd
|
dest: /etc/motd
|
||||||
state: link
|
state: link
|
||||||
|
|
||||||
- name: Disable Proxmox profile banner
|
- name: Check for default Ubuntu MOTD scripts
|
||||||
|
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: /etc/profile.d/pve.sh
|
path: "{{ item.stat.path }}"
|
||||||
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_noise.files }}"
|
loop: "{{ motd_scripts.results }}"
|
||||||
|
when: item.stat.exists
|
||||||
# ----------------------------
|
|
||||||
# DEPLOY TWS MOTD
|
|
||||||
# ----------------------------
|
|
||||||
|
|
||||||
- name: Deploy TWS MOTD script
|
- name: Deploy TWS MOTD script
|
||||||
copy:
|
copy:
|
||||||
@@ -69,6 +43,7 @@
|
|||||||
|
|
||||||
ORG="{{ tws_org }}"
|
ORG="{{ tws_org }}"
|
||||||
SHORT="{{ tws_short }}"
|
SHORT="{{ tws_short }}"
|
||||||
|
|
||||||
WIDTH=58
|
WIDTH=58
|
||||||
|
|
||||||
line() {
|
line() {
|
||||||
|
|||||||
Reference in New Issue
Block a user