mg
d7dd0ef313
zed defaults zed syntax scrub syntax sanoid mit ts health syntax arc syntax tmux syntax smart syntax restic handler restic syntax postfix syntax chrony syntax muster script mit ts muster syntax motd meta motd syntax smb syntax f2b syntax moreutils als standardsoftware rasdaemon + cv4pve. date durch ts ersetzt dokuwiki defaults dokuwiki syntax cv4 handler entfernt apt manage sources: / in var apt install packages syntax apcupsd syntax acng defaults acng syntax Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#65 Co-Authored-By: mg <mg@noreply.git.mgrote.net> Co-Committed-By: mg <mg@noreply.git.mgrote.net>
101 lines
2.3 KiB
YAML
101 lines
2.3 KiB
YAML
---
|
|
- name: install fortune
|
|
become: yes
|
|
ansible.builtin.package:
|
|
name:
|
|
- fortune
|
|
state: present
|
|
when: motd_fortune_aktiv
|
|
|
|
- name: install packages
|
|
become: yes
|
|
ansible.builtin.package:
|
|
name:
|
|
- update-motd
|
|
state: present
|
|
when: ansible_facts['os_family'] == "Ubuntu"
|
|
|
|
- name: 'remove unwanted motd messages'
|
|
become: yes
|
|
ansible.builtin.file:
|
|
path: '/etc/update-motd.d/{{ item }}'
|
|
state: absent
|
|
with_items:
|
|
- 00-header
|
|
- 10-help-text
|
|
- 10-uname
|
|
- 50-motd-news
|
|
- 80-livepatch
|
|
- 50-landscape-sysinfo
|
|
- 51-cloudguest
|
|
- 99-esm
|
|
- 00-ansible
|
|
- 20-facts
|
|
- 90-updates
|
|
- 91-reboot
|
|
|
|
- name: delete "Last Login" - Message
|
|
become: yes
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/ssh/sshd_config
|
|
regexp: "#PrintLastLog yes"
|
|
line: "PrintLastLog no"
|
|
backrefs: yes
|
|
notify: restart_sshd
|
|
|
|
- name: delete "no warranty" - Message
|
|
become: yes
|
|
ansible.builtin.file:
|
|
path: /etc/motd
|
|
state: absent
|
|
|
|
- name: setup new motd
|
|
become: yes
|
|
ansible.builtin.template:
|
|
src: '{{ item }}'
|
|
dest: '/etc/update-motd.d/{{ item }}'
|
|
owner: root
|
|
group: root
|
|
mode: '755'
|
|
with_items:
|
|
- 00-ansible-mgrote
|
|
- 20-facts-mgrote
|
|
- 90-updates-mgrote
|
|
- 91-reboot-mgrote
|
|
notify: Erzwinge_Aktualisierung
|
|
|
|
- name: setup new motd - fortune
|
|
become: yes
|
|
ansible.builtin.template:
|
|
src: '05-fortune-mgrote'
|
|
dest: '/etc/update-motd.d/05-fortune-mgrote'
|
|
owner: root
|
|
group: root
|
|
mode: '755'
|
|
notify: Erzwinge_Aktualisierung
|
|
when: motd_fortune_aktiv
|
|
|
|
- name: delete fortune
|
|
become: yes
|
|
ansible.builtin.file:
|
|
path: /etc/update-motd.d/05-fortune-mgrote
|
|
state: absent
|
|
when: not motd_fortune_aktiv
|
|
|
|
- name: setup new motd - wetter
|
|
become: yes
|
|
ansible.builtin.template:
|
|
src: '10-wetter-mgrote'
|
|
dest: '/etc/update-motd.d/10-wetter-mgrote'
|
|
owner: root
|
|
group: root
|
|
mode: '755'
|
|
notify: Erzwinge_Aktualisierung
|
|
when: motd_wetter_aktiv
|
|
|
|
- name: delete Wetter
|
|
become: yes
|
|
ansible.builtin.file:
|
|
path: '/etc/update-motd.d/10-wetter-mgrote'
|
|
state: absent
|
|
when: not motd_wetter_aktiv
|