ansible/roles/update_motd/tasks/main.yml
Jeltz 71ee06c9c0
Some checks failed
continuous-integration/drone/push Build is failing
Fix typo
2021-03-06 04:45:00 +01:00

53 lines
1 KiB
YAML

---
- name: Ensure update-motd.d exists
become: true
file:
path: /etc/update-motd.d
state: directory
mode: u=rwx,g=rx,o=rx
owner: root
group: root
- name: Customize motd
become: true
template:
src: "{{ item }}"
dest: "/etc/update-motd.d/{{ item }}"
mode: u=rwx,g=rx,o=rx
owner: root
group: root
loop:
- 00-logo
- 10-messages
- 20-uname
notify: Remove cached motd
- name: Remove Debian warranty motd
become: true
file:
path: /etc/motd
state: absent
notify: Remove cached motd
- name: Ensure motd-messages exists
become: true
file:
path: /etc/motd-messages
state: directory
mode: u=rwx,g=rx,o=rx
owner: root
group: root
notify: Remove cached motd
- name: Install additional motd messages
become: true
copy:
content: "✨ {{ item.message }}\n"
dest: "/etc/motd-messages/{{ item.key }}"
mode: u=rwx,g=rx,o=rx
owner: root
group: root
loop: "{{ motd_messages }}"
notify: Remove cached motd
when: motd_messages is defined
...