From 07f35ae27f8bf8c6ac4716c3ff0e0b3d9bd9af6d Mon Sep 17 00:00:00 2001 From: Zakaria Date: Tue, 27 Aug 2024 04:39:14 +0000 Subject: [PATCH] Update test.yml --- test.yml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/test.yml b/test.yml index 77de037..3c2fb9c 100644 --- a/test.yml +++ b/test.yml @@ -1,9 +1,32 @@ --- -- hosts: all +- name: Test connectivity and gather system information + hosts: all become: false tasks: - - name: Install Vim - apt: - upgrade: dist - update_cache: yes + - name: Ping the servers + ansible.builtin.ping: + + - name: Gather system information + ansible.builtin.setup: + gather_subset: + - 'network' + - 'virtualization' + - 'hardware' + + - name: Display the hostname + ansible.builtin.debug: + msg: "Hostname: {{ ansible_hostname }}" + + - name: Display the operating system + ansible.builtin.debug: + msg: "Operating System: {{ ansible_distribution }} {{ ansible_distribution_version }}" + + - name: Display the uptime + ansible.builtin.command: + cmd: uptime + register: uptime_result + + - name: Show the uptime + ansible.builtin.debug: + msg: "Uptime: {{ uptime_result.stdout }}"