add initial motd role

This commit is contained in:
Chris Hammer
2022-03-18 20:31:42 -04:00
parent f2e4543d1a
commit 4fc5d5d7df
13 changed files with 181 additions and 0 deletions

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

@ -0,0 +1,18 @@
---
- name: Set host IP address or set a default
set_fact:
host_ip: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
- name: Get system uptime - Script
script: "scripts/get_uptime.pl {{ ansible_uptime_seconds }}"
register: node_uptime
changed_when: false
- name: Update MOTD
template:
src: templates/motd.j2
dest: "{{ __motd_file }}"
mode: 0644
changed_when: false