Compare commits

..

No commits in common. "main" and "1.0.30" have entirely different histories.
main ... 1.0.30

6 changed files with 29 additions and 18 deletions

View File

@ -4,5 +4,3 @@ skip_list:
- yaml[line-length]
- no-changed-when
- galaxy[no-changelog]
- no-free-form
- package-latest

View File

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

View File

@ -1,12 +1,16 @@
---
- name: Format uptime using Jinja
- name: Format uptime containing days
ansible.builtin.set_fact:
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 %}
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"
- name: Update MOTD

View File

@ -16,9 +16,9 @@
Host : {{ inventory_hostname }}
IP : {{ motd_host_ip }}
CPU : {{ ansible_processor_vcpus }} x {{ ansible_processor[2] | regex_replace('\\s+', ' ') }}
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 | trim }}
Up : {{ uptime_formatted }}

View File

@ -1,6 +1,7 @@
---
node_status_host : node-status.thezengarden.net
node_status_host : zg-lxut02.thezengarden.net
node_status_user : chris
node_status_group : chris
node_status_dir : /home/chris/node_status
node_status_file : status.csv
node_status_lc : 3

View File

@ -1,21 +1,29 @@
---
- name: Update package cache for Debian hosts
ansible.builtin.apt:
apt:
update_cache: true
when:
- "'apt' in ansible_pkg_mgr"
- ansible_distribution|lower == 'debian'
tags:
- skip_ansible_lint
- name: Update package cache for RHEL/CentOS/Fedora hosts
ansible.builtin.dnf:
dnf:
update_cache: true
when:
- "'dnf' in ansible_pkg_mgr"
- (ansible_distribution|lower == 'centos' or
ansible_distribution|lower == 'fedora' or
ansible_distribution|lower == 'redhat')
- ansible_distribution_major_version|int >= 8
tags:
- skip_ansible_lint
- name: Update all host packages
ansible.builtin.package: name=* state=latest
package: name=* state=latest
tags:
- skip_ansible_lint
...