Add uptime.yml

Changed files
+37 -17
+24 -17
inventory.yml
···
-
servers:
+
debianservers:
hosts:
hyperreal.coffee:
ansible_user: jas
···
ansible_host: 10.0.0.5
ansible_python_interpreter: /usr/bin/python3
+
rhelservers:
+
hosts:
+
nas-remote:
+
ansible_user: root
+
ansible_host: nas-remote.lyrebird-marlin.ts.net
+
ansible_python_interpreter: /usr/bin/python3
+
promservers:
hosts:
desktop:
···
ansible_user: root
ansible_host: nas-remote.lyrebird-marlin.ts.net
ansible_python_interpreter: /usr/bin/python3
-
# hyperreal.coffee:
-
# ansible_user: jas
-
# ansible_host: hyperreal.lyrebird-marlin.ts.net
-
# ansible_python_interpreter: /usr/bin/python3
-
# nas-local:
-
# ansible_user: jas
-
# ansible_host: nas-local.lyrebird-marlin.ts.net
-
# ansible_python_interpreter: /usr/bin/python3
-
# auxnode:
-
# ansible_user: jas
-
# ansible_host: auxnode.lyrebird-marlin.ts.net
-
# ansible_python_interpreter: /usr/bin/python3
-
# auxnode2:
-
# ansible_user: jas
-
# ansible_host: 10.0.0.5
-
# ansible_python_interpreter: /usr/bin/python3
+
hyperreal.coffee:
+
ansible_user: jas
+
ansible_host: hyperreal.lyrebird-marlin.ts.net
+
ansible_python_interpreter: /usr/bin/python3
+
nas-local:
+
ansible_user: jas
+
ansible_host: nas-local.lyrebird-marlin.ts.net
+
ansible_python_interpreter: /usr/bin/python3
+
auxnode:
+
ansible_user: jas
+
ansible_host: auxnode.lyrebird-marlin.ts.net
+
ansible_python_interpreter: /usr/bin/python3
+
auxnode2:
+
ansible_user: jas
+
ansible_host: 10.0.0.5
+
ansible_python_interpreter: /usr/bin/python3
+13
uptime.yml
···
+
---
+
- name: Get server uptimes
+
hosts:
+
- debianservers
+
- rhelservers
+
+
tasks:
+
- name: Get uptime
+
ansible.builtin.shell: uptime -p
+
register: uptime
+
+
- debug:
+
msg: "{{ uptime.stdout }}"