From 75b32e60aad2bc2d8d1746be1dbc6d6bf422592e Mon Sep 17 00:00:00 2001 From: binary Date: Thu, 19 Nov 2020 14:13:28 +0100 Subject: Move roles functionnality in sub-roles --- roles/common/tasks/main.yml | 15 ++++++++------- roles/common/templates/motd.j2 | 13 +++++++++++++ 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 roles/common/templates/motd.j2 (limited to 'roles/common') diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 6e816c7..5dca08d 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -27,13 +27,14 @@ group: "{{ group_root }}" mode: 0644 +- name: copy motd configuration file + template: + src: motd.j2 + dest: /etc/motd + owner: root + group: "{{ group_root }}" + mode: 0644 + - name: synchronize host hostname with config hostname hostname: name="{{ inventory_hostname }}" -- name: retrieve all users - shell: awk -F ":" '{ if($3 == 0 || $3 > 999 && $3 < 16000) { print $1 }}' /etc/passwd - register: valid_users_shell - -- name: change shell to zsh for all valid users - user: name="{{ item }}" shell="{{ path_zsh }}" - loop: "{{ valid_users_shell.stdout_lines }}" diff --git a/roles/common/templates/motd.j2 b/roles/common/templates/motd.j2 new file mode 100644 index 0000000..8090ab0 --- /dev/null +++ b/roles/common/templates/motd.j2 @@ -0,0 +1,13 @@ +{% set sep = "▍" %} + + {{ sep }} rgoncalves.se network + {{ sep }} + {{ sep }} support : support@rgoncalves.se + {{ sep }} look for changes : git.rgoncalves.se + + {{ sep }} system + {{ sep }} + {{ sep }} hostname : {{ ansible_hostname }} + {{ sep }} distribution : {{ ansible_distribution }} {{ ansible_distribution_version }} + {{ sep }} kernel revision : {{ ansible_kernel }} {{ ansible_kernel_version }} + -- cgit v1.2.3