show_ansible_facts.yaml 862 B

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: Show certain ansible_facts
  3. hosts: CentOS7-TEST
  4. gather_facts: yes
  5. become: true
  6. tasks:
  7. # - name: "distribution"
  8. # debug:
  9. # var: ansible_facts["distribution"]
  10. # tags: distro
  11. # - name: "distribution_version"
  12. # debug:
  13. # var: ansible_facts["distribution_version"]
  14. # tags: distrov
  15. - name: "distribution_major_version"
  16. debug:
  17. var: ansible_facts["distribution_major_version"]
  18. tags: distromajorv
  19. # - name: "distribution_release"
  20. # debug:
  21. # var: ansible_facts["distribution_release"]
  22. # tags: distrorelease
  23. - name: "os_family"
  24. debug:
  25. var: ansible_facts["os_family"]
  26. # tags: distrofamily
  27. # - name: "pkg_mgr"
  28. # debug:
  29. # var: ansible_facts["pkg_mgr"]
  30. # tags: distropkgmgr