From de98fe20570cfefdffba12b9a5a98c9f70cef211 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Wed, 23 Sep 2026 21:54:49 -0400 Subject: [PATCH] Replacing ansible.builtin.shell with ansible.builtin.command --- playbooks/sysinfo.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/playbooks/sysinfo.yml b/playbooks/sysinfo.yml index eb7b4c2..d2b6788 100644 --- a/playbooks/sysinfo.yml +++ b/playbooks/sysinfo.yml @@ -5,36 +5,36 @@ become: true tasks: - name: Show system CPU info - ansible.builtin.shell: lscpu - register: shell_result + ansible.builtin.command: lscpu + register: cmd_output changed_when: false - name: Print stdout to terminal ansible.builtin.debug: - var: shell_result.stdout_lines + var: cmd_output.stdout_lines - name: RAM Info hosts: all become: true tasks: - name: Show free and used memory - ansible.builtin.shell: free -h - register: shell_result + ansible.builtin.command: free -h + register: cmd_output changed_when: false - name: Print stdout to terminal ansible.builtin.debug: - var: shell_result.stdout_lines + var: cmd_output.stdout_lines - name: Disk Info hosts: all become: true tasks: - name: Show mounted disks and their usage - ansible.builtin.shell: df -h - register: shell_result + ansible.builtin.command: df -h + register: cmd_output changed_when: false - name: Print stdout to terminal ansible.builtin.debug: - var: shell_result.stdout_lines + var: cmd_output.stdout_lines