Skip to content

Instantly share code, notes, and snippets.

@pfriedland
Forked from kguay/ansible-debug-os.yml
Created October 3, 2018 18:47
Show Gist options
  • Save pfriedland/396d5a86024b5c724c6e8960fd7a4b91 to your computer and use it in GitHub Desktop.
Save pfriedland/396d5a86024b5c724c6e8960fd7a4b91 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 }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment