This commit is contained in:
parent
277b96c064
commit
67423daa30
@ -8,7 +8,7 @@ namespace: jchristianh
|
||||
name: baseos
|
||||
|
||||
# The version of the collection. Must be compatible with semantic versioning
|
||||
version: 1.0.30
|
||||
version: 1.0.31
|
||||
|
||||
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
|
||||
readme: README.md
|
||||
|
@ -1,16 +1,12 @@
|
||||
---
|
||||
- name: Format uptime containing days
|
||||
- name: Format uptime using Jinja
|
||||
ansible.builtin.set_fact:
|
||||
uptime_formatted: "{{ motd_host_uptime | regex_replace(motd_day_filter, motd_day_filter_repl) }}"
|
||||
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) }}"
|
||||
when:
|
||||
- "'day' not in motd_host_uptime"
|
||||
uptime_formatted: |
|
||||
{% if 'day' in motd_host_uptime %}
|
||||
{{ motd_host_uptime | regex_replace(motd_day_filter, motd_day_filter_repl) }}
|
||||
{% else %}
|
||||
{{ motd_host_uptime | regex_replace(motd_nonday_filter, motd_nonday_filter_repl) }}
|
||||
{% endif %}
|
||||
|
||||
|
||||
- name: Update MOTD
|
||||
|
@ -19,6 +19,6 @@ IP : {{ motd_host_ip }}
|
||||
CPU : {{ ansible_processor_vcpus }} x {{ ansible_processor[2] }}
|
||||
Memory : {{ "{0:0.2f}".format(ansible_memfree_mb/1024) }} GB free of {{ (ansible_memtotal_mb/1024)|round}} GB
|
||||
Platform : {{ ansible_distribution }} {{ ansible_distribution_version }} {{ ansible_kernel }}
|
||||
Up : {{ uptime_formatted }}
|
||||
Up : {{ uptime_formatted | trim }}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user