The following example describe how to use the ansible.builtin.shell
with Ansible to retrieve a system information and then set it to a variable using ansible.builtin.set_fact
.
- Ansible CLI
ansible-playbook ./play-run-cmd-example.yml
# You can also enable the verbose mode
ansible-playbook -vvv ./play-run-cmd-example.yml