2021-04-09 23:29:03 +02:00
|
|
|
---
|
2020-08-18 11:57:53 +02:00
|
|
|
- name: install fortune
|
|
|
|
become: yes
|
2021-01-02 10:30:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-18 11:57:53 +02:00
|
|
|
name:
|
|
|
|
- fortune
|
|
|
|
state: present
|
|
|
|
when: motd_fortune_aktiv
|
|
|
|
|
|
|
|
- name: install packages
|
|
|
|
become: yes
|
2021-01-02 10:30:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-18 11:57:53 +02:00
|
|
|
name:
|
|
|
|
- update-motd
|
|
|
|
state: present
|
|
|
|
when: ansible_facts['os_family'] == "Ubuntu"
|
2021-04-09 23:29:03 +02:00
|
|
|
|
2021-06-22 14:09:51 +02:00
|
|
|
- name: remove default packages
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.package:
|
|
|
|
name:
|
|
|
|
- motd-news-config
|
|
|
|
state: absent
|
|
|
|
when: ansible_facts['os_family'] == "Ubuntu"
|
|
|
|
|
2021-03-10 14:50:54 +01:00
|
|
|
- name: 'remove unwanted motd messages'
|
2020-08-18 11:57:53 +02:00
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: '/etc/update-motd.d/{{ item }}'
|
|
|
|
state: absent
|
|
|
|
with_items:
|
2021-02-01 10:28:18 +01:00
|
|
|
- 00-header
|
2020-08-18 11:57:53 +02:00
|
|
|
- 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
|
2021-04-09 23:29:03 +02:00
|
|
|
|
2020-08-18 11:57:53 +02:00
|
|
|
- name: delete "Last Login" - Message
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.lineinfile:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: /etc/ssh/sshd_config
|
|
|
|
regexp: "#PrintLastLog yes"
|
|
|
|
line: "PrintLastLog no"
|
|
|
|
backrefs: yes
|
|
|
|
notify: restart_sshd
|
|
|
|
|
2021-02-22 13:11:22 +01:00
|
|
|
- name: delete "no warranty" - Message
|
|
|
|
become: yes
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/motd
|
|
|
|
state: absent
|
|
|
|
|
2020-08-18 11:57:53 +02:00
|
|
|
- name: setup new motd
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: /etc/update-motd.d/05-fortune-mgrote
|
|
|
|
state: absent
|
|
|
|
when: not motd_fortune_aktiv
|
|
|
|
|
|
|
|
- name: setup new motd - wetter
|
|
|
|
become: yes
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.template:
|
2020-08-18 11:57:53 +02:00
|
|
|
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
|
2020-11-21 19:41:19 +01:00
|
|
|
ansible.builtin.file:
|
2020-08-18 11:57:53 +02:00
|
|
|
path: '/etc/update-motd.d/10-wetter-mgrote'
|
|
|
|
state: absent
|
|
|
|
when: not motd_wetter_aktiv
|
2021-06-16 21:57:28 +02:00
|
|
|
|
|
|
|
- name: include systemctl tasks
|
|
|
|
include_tasks: systemctl.yml
|