From ac05da71732ff900c5f017d4e07b479241c5aeae Mon Sep 17 00:00:00 2001 From: Jeltz Date: Tue, 30 Mar 2021 10:08:21 +0200 Subject: [PATCH] Use update_motd everywhere --- roles/baseconfig/tasks/main.yml | 5 ----- roles/docker/tasks/main.yml | 13 ++++++++----- roles/nginx/tasks/main.yml | 13 ++++++++----- roles/re2o_service/tasks/main.yml | 14 +++++++++----- roles/unifi_controller/tasks/main.yml | 13 ++++++++----- 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/roles/baseconfig/tasks/main.yml b/roles/baseconfig/tasks/main.yml index cdedd37..77cb834 100644 --- a/roles/baseconfig/tasks/main.yml +++ b/roles/baseconfig/tasks/main.yml @@ -32,11 +32,6 @@ - include_role: name: update_motd -- name: Remove Debian warranty motd - file: - path: /etc/motd - state: absent - # Configure APT mirrors on Debian Stretch - name: Configure APT mirrors when: diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 66eed8c..5484f88 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -51,8 +51,11 @@ dest: /usr/local/bin/docker-compose mode: "0755" -- name: Indicate role in motd - template: - src: update-motd.d/05-service.j2 - dest: /etc/update-motd.d/05-docker - mode: 0755 +- include_role: + name: update_motd + vars: + motd_messages: + - key: 10-docker + message: >- + Docker est installé sur ce serveur. +... diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index a8fb885..146b93c 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -148,11 +148,13 @@ group: www-data mode: 0644 -- name: Indicate role in motd - template: - src: update-motd.d/05-service.j2 - dest: /etc/update-motd.d/05-nginx - mode: 0755 +- include_role: + name: update_motd + vars: + motd_messages: + - key: 10-nginx + message: >- + NGinx est installé sur ce serveur. Voir /etc/nginx. - name: Clean old files file: @@ -162,3 +164,4 @@ - "/etc/nginx/snippets/options-ssl.conf" - "/var/www/custom_401.html" - "/var/www/robots.txt" +... diff --git a/roles/re2o_service/tasks/main.yml b/roles/re2o_service/tasks/main.yml index 68e963c..882fdf9 100644 --- a/roles/re2o_service/tasks/main.yml +++ b/roles/re2o_service/tasks/main.yml @@ -40,8 +40,12 @@ group: nogroup state: link -- name: Indicate in motd service location - template: - src: update-motd.d/05-service.j2 - dest: "/etc/update-motd.d/05-re2o-{{ service_name }}" - mode: 0755 +- include_role: + name: update_motd + vars: + motd_messages: + - key: "15-re2o-service-{{ service_name }}" + message: >- + Le service re2o {{ service_name }} est dans + {{ service_homedir }}/{{ service_name }}. +... diff --git a/roles/unifi_controller/tasks/main.yml b/roles/unifi_controller/tasks/main.yml index 7f886f2..b43c74b 100644 --- a/roles/unifi_controller/tasks/main.yml +++ b/roles/unifi_controller/tasks/main.yml @@ -40,8 +40,11 @@ retries: 3 until: apt_result is succeeded -- name: Indicate role in motd - template: - src: update-motd.d/05-service.j2 - dest: /etc/update-motd.d/05-unifi-controller - mode: 0755 +- include_role: + name: update_motd + vars: + motd_messages: + - key: 10-unifi-controller + message: >- + Le contrôleur Unifi a été installé sur ce serveur. +... -- 2.45.2