From 77fbef0447528237af568067196e8f722155f456 Mon Sep 17 00:00:00 2001 From: Mark Hoekveen Date: Sun, 2 Feb 2025 21:58:54 +0100 Subject: [PATCH] adds motd task --- .gitmodules | 4 ++-- files/motd | 1 - playbook.yml | 1 + tasks/motd | 1 + tasks/motd.yml | 6 ++++++ 5 files changed, 10 insertions(+), 3 deletions(-) delete mode 160000 files/motd create mode 160000 tasks/motd create mode 100644 tasks/motd.yml diff --git a/.gitmodules b/.gitmodules index 91e86a5..e8828a3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "files/motd"] - path = files/motd +[submodule "motd"] + path = tasks/motd url = gitea@git.hoekveen.net:mark/motd.git diff --git a/files/motd b/files/motd deleted file mode 160000 index 9614418..0000000 --- a/files/motd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 96144180794da420da7b1b995762914a3523dc2b diff --git a/playbook.yml b/playbook.yml index 9bc9832..971692e 100644 --- a/playbook.yml +++ b/playbook.yml @@ -32,6 +32,7 @@ - (inventory_hostname in groups['home'] and (item in groups['home'] or item in groups['cloud'])) or (inventory_hostname not in groups['home'] and item in groups['cloud']) with_items: "{{ groups.all }}" + - import_tasks: tasks/motd.yml - name: Update Debian hosts hosts: debian become: true diff --git a/tasks/motd b/tasks/motd new file mode 160000 index 0000000..3e07a8e --- /dev/null +++ b/tasks/motd @@ -0,0 +1 @@ +Subproject commit 3e07a8e03f765ca17ac3df0ec786cdc3e9a3fabc diff --git a/tasks/motd.yml b/tasks/motd.yml new file mode 100644 index 0000000..d50072d --- /dev/null +++ b/tasks/motd.yml @@ -0,0 +1,6 @@ +- name: Copy motd + copy: + content: "{{ lookup('file', 'motd/titles/' + inventory_hostname, errors='ignore') | default('') }}" + dest: /etc/motd + mode: "0644" + ignore_errors: true