Skip to main content

Playbook on Uname

Updated Dec 03, 2020 ·

Overview

This lab creates a simple Ansible playbook that runs uname on the target host groups to confirm the operating system type returned by each managed node.

Diagram:

# sample-uname.yml
# ansible -m shell -a "uname" webservers
---

- name: Checks uname
hosts: webservers:loadbalancers
tasks:
- name: Get OS Type
shell: uname

To test,

ansible-playbook playbooks/sample-uname.yml