Skip to content

Instantly share code, notes, and snippets.

@kguay
Created November 27, 2017 20:17
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kguay/14676da2b66197a404f16e3bc90bb186 to your computer and use it in GitHub Desktop.
Save kguay/14676da2b66197a404f16e3bc90bb186 to your computer and use it in GitHub Desktop.
Ansible playbook to get os distro and version for all hosts. Works on Fedora/CentOS/RedHat machines.
- name: Print linux distribution and version
hosts: all
tasks:
- name: capture output of id command
command: cat /etc/system-release
register: login
- debug: msg="{{ login.stdout }}"
@gianlucaceci
Copy link

how use for multi version os?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment