add dynamic motd with hostname, ip and other stats

This commit is contained in:
2017-06-23 09:13:58 -04:00
parent e7d94e2c3a
commit 4c5d84de54
9 changed files with 402 additions and 4 deletions

37
roles/motd/tasks/main.yml Normal file
View File

@@ -0,0 +1,37 @@
---
# main tasks for setting up motd dynamic shell header
- name: Install the nginx packages
apt:
name: "{{ item }}"
update_cache: yes
cache_valid_time: 3600
state: latest
with_items:
- lsb-release
- figlet
- update-motd
- lm-sensors
when: "ansible_nodename != 'cubox-i'"
- name: remove help text
file:
state: absent
path: "{{ item }}"
with_items:
- /etc/update-motd.d/10-help-text
- /etc/update-motd.d/51-cloudguest
when: "ansible_nodename != 'cubox-i'"
- name: add new info
copy:
src: "{{ item.src }}"
dest: /etc/update-motd.d/{{ item.dest }}
mode: 755
with_items:
- { src: hostname.sh, dest: 10-hostname }
- { src: systats.sh, dest: 11-sysstats}
when: "ansible_nodename != 'cubox-i'"