Chris Hammer db75e69d99
All checks were successful
continuous-integration/drone/push Build is passing
Update motd role to no longer require Perl dependancy or script
2024-03-01 16:59:32 -05:00

25 lines
637 B
YAML

---
- name: Format uptime containing days
ansible.builtin.set_fact:
uptime_formatted: "{{ motd_host_uptime | regex_replace(motd_day_filter, '\\1 \\2 hours \\3 minutes') }}"
when:
- "'day' in motd_host_uptime"
- name: Format uptime not containing days
ansible.builtin.set_fact:
uptime_formatted: "{{ motd_host_uptime | regex_replace(motd_nonday_filter, '\\1 hours \\2 minutes \\3 seconds') }}"
when:
- "'day' not in motd_host_uptime"
- name: Update MOTD
ansible.builtin.template:
src : templates/motd.j2
dest : "{{ motd_motd_file }}"
mode : "0644"
changed_when : false
...