Initial commit

This commit is contained in:
waal70
2024-10-26 16:23:45 +02:00
commit b00d31c48d
22 changed files with 475 additions and 0 deletions

24
tasks/motd.yml Normal file
View File

@@ -0,0 +1,24 @@
---
- name: Prepare a custom motd, but do not affect 'proxmox_servers'
when: "'proxmox_servers' not in group_names"
block:
- name: Set a custom motd for all Debian-based systems # noqa: deprecated-bare-vars
ansible.builtin.template:
src: "{{ item.src }}"
dest: "/etc/update-motd.d/{{ item.path }}"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: "0777"
with_community.general.filetree:
- templates/etc/update-motd.d/
when: item.state == "file"
- name: Check for existence of motd
ansible.builtin.stat:
path: /etc/motd
register: motd_file
- name: Backup current motd
ansible.builtin.command: mv /etc/motd /etc/motd.bak
when: motd_file.stat.exists
changed_when: motd_file.stat.exists