40 lines
874 B
YAML
40 lines
874 B
YAML
|
- name: Find unwanted motd scripts
|
||
|
ansible.builtin.find:
|
||
|
paths: /etc/update-motd.d/
|
||
|
file_type: any
|
||
|
register: collected_files
|
||
|
|
||
|
- name: Delete unwanted motd scripts
|
||
|
ansible.builtin.file:
|
||
|
path: "{{ item.path }}"
|
||
|
state: absent
|
||
|
with_items: "{{ collected_files.files }}"
|
||
|
|
||
|
- name: Remove Debian legal notice (/etc/motd)
|
||
|
ansible.builtin.file:
|
||
|
path: /etc/motd
|
||
|
state: absent
|
||
|
|
||
|
- name: Detect Armbian
|
||
|
ansible.builtin.stat:
|
||
|
path: /etc/armbian-release
|
||
|
register: armbian
|
||
|
|
||
|
- name: Add custom /etc/motd for Armbian
|
||
|
ansible.builtin.copy:
|
||
|
src: motd.orangepi
|
||
|
dest: /etc/motd
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0755
|
||
|
when: armbian.stat.exists == True
|
||
|
|
||
|
- name: Add common custom /etc/motd
|
||
|
ansible.builtin.copy:
|
||
|
src: motd.cube
|
||
|
dest: /etc/motd
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0755
|
||
|
when: armbian.stat.exists == False
|