feat: move to dedicated repo

This commit is contained in:
Simon Cornet 2024-11-22 11:13:16 +01:00
commit 4a88a5b28d
54 changed files with 1524 additions and 0 deletions

43
tasks/motd.yaml Normal file
View file

@ -0,0 +1,43 @@
---
# find old motd files
- name: "motd - find old scripts"
ansible.builtin.find:
paths: "/etc/update-motd.d/"
file_type: "file"
excludes:
- "10-custom-motd"
register: "old_motd"
tags:
- "motd"
# remove old custom motd files
- name: "motd - cleanup directory"
ansible.builtin.file:
path: "{{ item.path }}"
state: "absent"
loop: "{{ old_motd.files }}"
when: "old_motd.files|length > 0"
tags:
- "motd"
# remove old motd files
- name: "motd - cleanup main file"
ansible.builtin.file:
path: "/etc/motd"
state: "absent"
when: "inventory_hostname != 'bastion.siempie.internal'"
tags:
- "motd"
# configure motd
- name: "motd - siempie"
ansible.builtin.template:
src: "templates/motd/motd.sh.j2"
dest: "/etc/update-motd.d/10-custom-motd"
owner: "root"
group: "root"
mode: "0755"
when: 'ansible_os_family == "Debian"'
tags:
- "motd"