From b82afd13d9c2475080e3ed8d82844286375bfa07 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 27 Nov 2021 19:14:39 +0100 Subject: [PATCH] update_motd: use update_motd dict --- backups.yml | 6 ++++++ roles/update_motd/tasks/main.yml | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/backups.yml b/backups.yml index 4886548..f4d305c 100644 --- a/backups.yml +++ b/backups.yml @@ -1,7 +1,13 @@ --- - hosts: perceval.adm.auro.re + vars: + update_motd: + borgbackup_server: >- + Les sauvegardes (borg) sont stockées dans + {{ borg_server_backups_dir }}. roles: - borgbackup_server + - update_motd - hosts: all,!unifi,!unifi-*,!wiki.adm.auro.re roles: diff --git a/roles/update_motd/tasks/main.yml b/roles/update_motd/tasks/main.yml index e0ae1f8..1ba08f5 100644 --- a/roles/update_motd/tasks/main.yml +++ b/roles/update_motd/tasks/main.yml @@ -43,12 +43,12 @@ - name: Install additional motd messages copy: - content: "✨ {{ item.message }}\n" + content: "✨ {{ item.value }}\n" dest: "/etc/motd-messages/{{ item.key }}" - mode: u=rwx,g=rx,o=rx + mode: u=rw,g=r,o=r owner: root group: root - loop: "{{ motd_messages }}" + loop: "{{ update_motd | dict2items }}" notify: Remove cached motd - when: motd_messages is defined + when: update_motd is defined ...