update_motd: use update_motd dict

This commit is contained in:
Alexandre Iooss 2021-11-27 19:14:39 +01:00
parent 00d63cf082
commit b82afd13d9
2 changed files with 10 additions and 4 deletions

View file

@ -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:

View file

@ -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
...