Logic updates, CI fixes, formatting
Some checks failed
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Successful in 14s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian) (push) Failing after 12s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora) (push) Failing after 12s
Some checks failed
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-centos) (push) Successful in 14s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-debian) (push) Failing after 12s
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora) (push) Failing after 12s
This commit is contained in:
@ -1,33 +1,33 @@
|
||||
---
|
||||
- name: Update node status when not running in a container
|
||||
when: not ansible_virtualization_type | regex_search("docker|podman|container")
|
||||
when: not ansible_virtualization_type is search("docker|podman|container")
|
||||
block:
|
||||
- name: Create directory {{ node_status_dir }}
|
||||
ansible.builtin.file:
|
||||
path : "{{ node_status_dir }}"
|
||||
state : directory
|
||||
mode : '0755'
|
||||
become : false
|
||||
run_once : true
|
||||
delegate_to : "{{ node_status_host }}"
|
||||
path: "{{ node_status_dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
become: false
|
||||
run_once: true
|
||||
delegate_to: "{{ node_status_host }}"
|
||||
|
||||
|
||||
- name: Capture system uptime
|
||||
ansible.builtin.command : uptime
|
||||
register : r_node_status_uptime
|
||||
register: r_node_status_uptime
|
||||
changed_when: false
|
||||
|
||||
|
||||
- name: Log node status
|
||||
ansible.builtin.lineinfile:
|
||||
path : "{{ node_status_dir }}/{{ node_status_file }}"
|
||||
state : present
|
||||
regexp : "{{ inventory_hostname }}"
|
||||
line : "{{ ansible_date_time.epoch }},,{{ inventory_hostname }},,{{ ansible_distribution }} {{ ansible_distribution_version }},,{{ r_node_status_uptime.stdout }}"
|
||||
create : true
|
||||
mode : '0644'
|
||||
owner : "{{ node_status_user }}"
|
||||
group : "{{ node_status_group }}"
|
||||
delegate_to : "{{ node_status_host }}"
|
||||
throttle : 1
|
||||
path: "{{ node_status_dir }}/{{ node_status_file }}"
|
||||
state: present
|
||||
regexp: "{{ inventory_hostname }}"
|
||||
line: "{{ ansible_date_time.epoch }},,{{ inventory_hostname }},,{{ ansible_distribution }} {{ ansible_distribution_version }},,{{ r_node_status_uptime.stdout }}"
|
||||
create: true
|
||||
mode: '0644'
|
||||
owner: "{{ node_status_user }}"
|
||||
group: "{{ node_status_group }}"
|
||||
delegate_to: "{{ node_status_host }}"
|
||||
throttle: 1
|
||||
|
||||
|
Reference in New Issue
Block a user