Compare commits

..

No commits in common. "584a33172ca9141aac660caa7c3f2edd1a8eb613" and "3cc31ecb4011255352c69eb63399403cf3b5b4a1" have entirely different histories.

3 changed files with 3 additions and 5 deletions

View File

@ -8,7 +8,7 @@ namespace: jchristianh
name: baseos
# The version of the collection. Must be compatible with semantic versioning
version: 1.0.29
version: 1.0.28
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md

View File

@ -7,7 +7,5 @@ motd_host_uptime : "{{ now().replace(microsecond=0) - now().fromtimestamp(now(
motd_day_filter : "(.* day[s]?),\\s+(\\d+):(\\d+):(\\d+)"
motd_nonday_filter : "(\\d+):(\\d+):(\\d+)"
motd_day_filter_repl : "\\1 \\2 hours \\3 minutes"
motd_nonday_filter_repl : "\\1 hours \\2 minutes \\3 seconds"
...

View File

@ -1,14 +1,14 @@
---
- name: Format uptime containing days
ansible.builtin.set_fact:
uptime_formatted: "{{ motd_host_uptime | regex_replace(motd_day_filter, motd_day_filter_repl) }}"
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, motd_nonday_filter_repl) }}"
uptime_formatted: "{{ motd_host_uptime | regex_replace(motd_nonday_filter, '\\1 hours \\2 minutes \\3 seconds') }}"
when:
- "'day' not in motd_host_uptime"